library(ggplot2)
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.1.2 ✔ readr 2.1.4
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ lubridate 1.9.2 ✔ tibble 3.2.1
## ✔ purrr 1.0.2 ✔ tidyr 1.3.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag() masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(dplyr)
library(meta)
## Loading 'meta' package (version 6.5-0).
## Type 'help(meta)' for a brief overview.
## Readers of 'Meta-Analysis with R (Use R!)' should install
## older version of 'meta' package: https://tinyurl.com/dt4y5drs
library(PRISMAstatement)
library(skimr)
library(MASS)
##
## Attaching package: 'MASS'
##
## The following object is masked from 'package:dplyr':
##
## select
library(ggpubr)
library(patchwork)
##
## Attaching package: 'patchwork'
##
## The following object is masked from 'package:MASS':
##
## area
### Load and clean up dirty data
#photo <- read.csv("observations.csv")
#photo <- photo %>%
# filter(common_name != "Human")
#photo <- photo %>%
# filter(common_name != "Human-Camera Trapper")
#photo <- photo %>%
# filter(common_name != "Domestic Dog")
#photo <- photo %>%
# filter(common_name != "Vehicle")
#photo <- photo %>%
# dplyr::filter(common_name != "Insect")
#photo <- photo %>%
# dplyr::filter(common_name != "Animal")
#photo <- photo %>%
# dplyr::filter(common_name != "Bird")
#photo <- photo %>%
# filter(common_name != "No CV Result")
#count.hit <- photo %>%
# count(animal.hit) %>%
# na.omit()
#summary(count.hit)
### 0.489% capture rate
### Total Observations is species list!
#Total_Observations <- photo %>% group_by(common_name) %>% summarise(total = sum(animal.hit)) %>% filter(common_name != "Blank") %>% filter(common_name != "No CV Result") %>% filter(common_name != "Mammal")
#animals_by_factor <- photo %>% group_by(factor,common_name, scientific_name) %>% summarise(captures = sum(animal.hit))
#animals_by_factor <- animals_by_factor %>% filter(common_name != "Blank") %>% filter(common_name != "No CV Result")
#factor_obvs <- merge(animals_by_factor, Total_Observations, all = TRUE)
#factor_obvs$percent_presence <- factor_obvs$captures/factor_obvs$total
### Rought version of percent proportion figure.
#write.csv(factor_obvs, file = "scientific.csv")
scientific <- read.csv("scientific.csv")
#plot1 <- ggplot(scientific, aes(scientific_name, percent_presence, fill = factor)) + geom_bar(stat = "identity") + coord_flip() + theme_classic() + scale_x_discrete(limits=rev) + xlab("Species") + ylab("Percent Proportion") + labs(fill = "factor")
#plot1 + scale_fill_manual(values = c("#009900", "#0066cc", "#8B0000")) + scale_x_discrete(limits = rev(levels(factor_obvs$scientific_name)))
### This figure works well!
library(dplyr)
library(ggplot2)
# Calculate the total counts of each species
scientific <- scientific %>%
group_by(scientific_name, factor) %>%
summarize(total_counts = sum(percent_presence))
## `summarise()` has grouped output by 'scientific_name'. You can override using
## the `.groups` argument.
# Create a custom order based on percent presence
custom_order <- scientific %>%
arrange(factor, -total_counts) %>%
pull(scientific_name)
# Create a numeric variable to represent the custom order
scientific <- scientific %>%
mutate(order_var = match(scientific_name, custom_order))
# Create the bar plot with custom x-axis order
plot1 <- ggplot(scientific, aes(factor(order_var), total_counts, fill = factor)) +
geom_bar(stat = "identity") +
coord_flip() +
theme_classic() +
xlab("Species") +
ylab("Relative Proportion") +
labs(fill = "Microsite") +
scale_fill_brewer(palette = "Paired") +
scale_x_continuous(breaks = 1:length(custom_order), labels = custom_order) + scale_x_discrete(labels = custom_order) + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10))
## Scale for x is already present.
## Adding another scale for x, which will replace the existing scale.
## Warning: The `size` argument of `element_rect()` is deprecated as of ggplot2 3.4.0.
## ℹ Please use the `linewidth` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
plot1
### Determine animal abundance at each site (This will also help with PCOA)
#photo_final <- photo %>% filter(common_name != "Blank") %>% filter(common_name != "No CV Result") %>% filter(common_name != "Mammal")
#write.csv(photo_final, file = "observations.csv") ### Use this as final data
photo_final <- read.csv("observations.csv")
Total_Observations_factors <- photo_final %>% group_by(site_code, factor, microsite_number) %>% summarise(total = sum(animal_hit))
## `summarise()` has grouped output by 'site_code', 'factor'. You can override
## using the `.groups` argument.
#animals_density <- photo %>% group_by(site_code,factor, common_name, microsite_number) %>% summarise(captures = sum(animal.hit))
#animals_density <- animals_density %>% filter(common_name != "Blank")
library(dplyr)
### Geolocated Shrub Density setup and cleanup.
Cuyama_shrubs <- read.csv("Cuyama.csv")
Cuyama_shrubs <- Cuyama_shrubs %>% filter(site_code != "Cuyama_2") %>% filter(site_code != "Cuyama_4") %>% filter(site_code != "Cuyama_5") %>% filter(site_code != "Cuyama_6")
Carrizo_shrubs <- read.csv("Carrizo.csv")
Carrizo_shrubs <- Carrizo_shrubs %>% filter(site_code != "Carrizo_1")%>% filter(site_code != "Carrizo_2")%>% filter(site_code != "Carrizo_3")%>% filter(site_code != "Carrizo_4")%>% filter(site_code != "Carrizo_5")%>% filter(site_code != "Carrizo_6")%>% filter(site_code != "Carrizo_7")
shrubs <- rbind(Carrizo_shrubs, Cuyama_shrubs)
### Combine site level data with geolocated data to determine the shrub density around each mimic, shrub and open area. Use Lizard code!!!
library(tidyverse)
library(sf)
## Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE
library(RColorBrewer)
library(scales)
##
## Attaching package: 'scales'
## The following object is masked from 'package:purrr':
##
## discard
## The following object is masked from 'package:readr':
##
## col_factor
#set key attributes####
x = 4326 #crs for first spatial df
y = 4326 #crs for second spatial df
z = 20 #set buffer is using a join to point data SET FOR 20M
shrubs <- shrubs %>%
st_as_sf(coords=c("long","lat"), crs = x, remove=FALSE) %>%
st_transform(32610) #crs = 32610 is UTM and will return distances in meters
site <- read_csv("Chpt5_Site_Data.csv") %>%
st_as_sf(coords=c("long","lat"), crs = y, remove=FALSE) %>%
st_transform(32610) #crs = 32610 is UTM and will return distances in meters
## Rows: 58 Columns: 8
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (3): site_code, factor, functioned
## dbl (5): rep, site number, lat, long, pendant_ID
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
buffer <- st_buffer(site, z) #decide on spatial scale
joined.xy <- st_intersection(buffer, shrubs)
## Warning: attribute variables are assumed to be spatially constant throughout
## all geometries
joined.xy <- joined.xy %>%
group_by(rep) %>%
summarize(n_shrubs = n()) %>%
st_drop_geometry
tidy_all <- left_join(site, joined.xy, by = "rep") %>%
dplyr::mutate(n_shrubs = replace_na(n_shrubs, 0))
max(tidy_all$n_shrubs) #checks ecological viability
## [1] 30
min(tidy_all$n_shrubs) #checks ecological viability
## [1] 0
sum(tidy_all$n_shrubs) #checks positive co-occurrences
## [1] 611
nrow(buffer) - nrow(tidy_all) #ensure that tidy dataframe comprised all buffers
## [1] 0
#write data AS tidy_20m
#write.csv(tidy_all, file = "tidy_20m.csv")
library(dplyr)
tidy_20m <- read.csv("tidy_20m.csv")%>%
distinct(rep, .keep_all = TRUE)
###write.csv(tidy_20m, file = "tidy_20m.csv")
###THIS SHOULD BE ALL CLEANED UP AND NOW WORK!!!
### PCOA
library(vegan)
## Loading required package: permute
## Loading required package: lattice
## This is vegan 2.6-4
library(ape)
##
## Attaching package: 'ape'
## The following object is masked from 'package:ggpubr':
##
## rotate
## The following object is masked from 'package:dplyr':
##
## where
animals_density_final <- photo_final %>% group_by(site_code,factor,microsite_number, common_name) %>% summarise(captures = sum(animal_hit))
## `summarise()` has grouped output by 'site_code', 'factor', 'microsite_number'.
## You can override using the `.groups` argument.
pca_data_final <- animals_density_final ### Created new df for pca data
pca_data_final <- pca_data_final %>%
spread(common_name, captures) %>%
ungroup() %>%
dplyr::select(-site_code, -factor, -microsite_number) %>%
replace(is.na(.),0)
dim(pca_data_final)
## [1] 53 21
env_final <- read.csv("environment.csv") ### Drop Tecopa open 1, Tecopa open 4, since they have no animal observations.
dim(env_final)
## [1] 53 5
model010 <- adonis(pca_data_final ~ factor+shrub_density, data = env_final)
## 'adonis' will be deprecated: use 'adonis2' instead
model010
## $aov.tab
## Permutation: free
## Number of permutations: 999
##
## Terms added sequentially (first to last)
##
## Df SumsOfSqs MeanSqs F.Model R2 Pr(>F)
## factor 2 0.7190 0.35951 1.1694 0.04212 0.308
## shrub_density 1 1.2885 1.28851 4.1913 0.07548 0.001 ***
## Residuals 49 15.0636 0.30742 0.88240
## Total 52 17.0712 1.00000
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## $call
## adonis(formula = pca_data_final ~ factor + shrub_density, data = env_final)
##
## $coefficients
## Bewick's Wren Black-tailed Jackrabbit California Ground Squirrel
## (Intercept) 0.0076319553 1.57842126 -0.011387527
## factor1 -0.0128239472 -0.17166774 -0.002104166
## factor2 0.0270797066 -0.45504757 -0.053282362
## shrub_density 0.0005352569 -0.03677871 0.006545535
## California Pocket Mouse California Quail Cassin's Kingbird
## (Intercept) -0.009216160 0.201627947 0.009885252
## factor1 0.011361669 0.330209739 -0.025167341
## factor2 0.040473648 -0.169199459 0.054549073
## shrub_density 0.004933453 -0.003282236 0.001575473
## Common Poorwill Common Raven Coyote Desert Cottontail
## (Intercept) 0.005102551 1.53102403 0.83092590 -0.16570596
## factor1 0.034366522 0.01478412 0.02186533 0.11723801
## factor2 -0.015828897 -0.05508749 -0.01344370 -0.02201191
## shrub_density 0.001085663 -0.05626888 -0.02606095 0.05138845
## Giant Kangaroo Rat Heermann's Kangaroo Rat Horned Lark
## (Intercept) 0.2236461935 42.922232 0.34904693
## factor1 -0.0157724889 5.006682 -0.15420995
## factor2 0.1043736211 7.953404 0.31847775
## shrub_density -0.0008117221 -1.704012 -0.01493165
## Kit Fox Loggerhead Shrike Mourning Dove
## (Intercept) 1.30200080 1.63788020 0.084954106
## factor1 0.41290996 0.88229861 0.131699453
## factor2 -0.20660716 0.09195141 -0.067991512
## shrub_density -0.05823822 -0.05362668 -0.001716862
## Nelson's Antelope Squirrel Red-tailed Hawk Salinas Pocket Mouse
## (Intercept) 5.5106881 0.0444105000 0.03084767
## factor1 2.3369656 -0.0403940534 0.04260460
## factor2 -0.1196759 0.0796804786 0.02211196
## shrub_density -0.1853251 -0.0004140667 0.00273688
## Say's Phoebe Song Sparrow
## (Intercept) 0.0185491971 0.101486306
## factor1 0.0331651398 -0.084955200
## factor2 -0.0168030478 -0.084648437
## shrub_density -0.0001767358 -0.001704238
##
## $coef.sites
## 1 2 3 4 5
## (Intercept) 0.936275457 0.926204692 0.57949457 0.55262669 0.610222530
## factor1 -0.050205797 0.016998412 0.03941641 0.04437136 0.026543387
## factor2 -0.017674861 0.075343266 -0.05155083 -0.01563137 -0.065002603
## shrub_density -0.008553169 -0.001238154 0.01022613 0.00940238 0.006715876
## 6 7 8 9 10
## (Intercept) 0.777242019 0.852058173 0.58608635 0.9257864943 0.95563208
## factor1 -0.041612390 -0.004972056 -0.01060948 0.0174686958 0.03692741
## factor2 0.002386197 -0.001167039 -0.01348249 -0.0591197112 0.05193310
## shrub_density -0.003860334 -0.006594950 0.01383112 0.0005773103 -0.00562015
## 11 12 13 14
## (Intercept) 0.895770431 0.9445820911 0.910485150 0.9445820911
## factor1 0.001734654 0.0239997735 0.046846314 0.0239997735
## factor2 0.032341752 -0.0713384528 0.089246857 -0.0713384528
## shrub_density -0.009063453 -0.0004010324 -0.001097481 -0.0004010324
## 15 16 17 18 19
## (Intercept) 0.7240134806 0.988997878 0.989568529 0.628236663 0.734035940
## factor1 -0.0421516204 0.007832231 0.001355325 0.039426078 -0.020556889
## factor2 0.0014222960 -0.008458344 0.037364794 -0.053097717 0.009279855
## shrub_density 0.0002140372 -0.006003473 -0.008149366 0.005630839 -0.003154350
## 20 21 22 23 24
## (Intercept) 0.849116203 0.987294774 0.854749137 0.923738530 0.887724497
## factor1 -0.021309556 -0.015100373 -0.044242542 -0.040625010 0.042308680
## factor2 0.003258647 -0.001243885 -0.015412171 -0.002078609 0.100568762
## shrub_density -0.009217237 -0.007575176 -0.007148741 -0.008938216 -0.002356877
## 25 26 27 28 29
## (Intercept) 0.936275457 0.731556747 0.647618294 0.6926429273 0.54947382
## factor1 -0.050205797 0.011891249 -0.002206746 0.0007272092 0.04568939
## factor2 -0.017674861 0.054178234 -0.055715480 -0.0143286949 -0.04795711
## shrub_density -0.008553169 -0.003562781 0.004547975 0.0081519152 0.01072234
## 30 31 32 33 34
## (Intercept) 0.766943208 0.754156996 0.63491138 0.655337994 0.622870994
## factor1 -0.034480106 -0.026628674 -0.03578040 0.001598991 0.001360762
## factor2 -0.024230700 -0.033313028 -0.01861093 -0.060408324 -0.045068645
## shrub_density 0.008905597 0.009354036 0.01356842 0.004606980 0.005245220
## 35 36 37 38 39
## (Intercept) 0.579718734 0.60371032 0.54552608 0.557621277 0.565385089
## factor1 0.008214607 -0.02984032 0.04271827 0.046084510 0.040188676
## factor2 -0.020719713 -0.01900946 -0.05037329 -0.003355421 -0.009586730
## shrub_density 0.013578295 0.01426815 0.01166769 0.010428737 0.008461571
## 40 41 42 43 44
## (Intercept) 0.53778473 0.57279308 0.51257919 0.739734525 0.686837166
## factor1 0.03840331 0.03026120 0.05695778 -0.023949999 -0.016346030
## factor2 -0.01593148 -0.04312069 -0.02323254 -0.028733281 0.014287801
## shrub_density 0.01216791 0.01243267 0.01144910 0.009710738 0.003589044
## 45 46 47 48 49
## (Intercept) 0.793263881 0.860713167 0.536006661 0.53760256 0.65048975
## factor1 -0.048109313 -0.051690340 0.046633363 0.04631280 -0.02889655
## factor2 -0.026089161 -0.029771764 -0.036217614 -0.05777980 -0.02215887
## shrub_density -0.003114114 -0.006472206 0.009675989 0.01095332 0.01318175
## 50 51 52 53
## (Intercept) 0.650342540 0.58461555 0.62135819 0.54052840
## factor1 0.001653830 -0.01223346 -0.03298820 0.04584001
## factor2 0.019105412 -0.01574979 -0.01459240 -0.06756914
## shrub_density 0.005595415 0.01401674 0.01373927 0.01026113
##
## $f.perms
## [,1] [,2]
## [1,] 1.4461376 1.67677802
## [2,] 1.1868632 0.69245344
## [3,] 0.7209208 0.49273782
## [4,] 1.3792895 0.99050594
## [5,] 1.0538471 2.51362828
## [6,] 0.9454759 1.34948294
## [7,] 0.5107032 1.00382780
## [8,] 0.7158408 1.49347330
## [9,] 0.4487468 1.33984075
## [10,] 0.6409588 2.36952199
## [11,] 1.4056209 2.47670843
## [12,] 0.7813397 1.15342910
## [13,] 1.1991570 0.27295704
## [14,] 1.3780557 0.85686240
## [15,] 2.1070759 1.43496376
## [16,] 1.0598819 1.40713451
## [17,] 1.4607214 0.96125379
## [18,] 1.2272589 1.73801333
## [19,] 0.8181903 0.25704254
## [20,] 0.8111971 0.64919631
## [21,] 2.1313521 1.01589270
## [22,] 1.4880529 0.67182757
## [23,] 1.2682062 0.92429304
## [24,] 1.7844338 0.50012946
## [25,] 0.6610279 0.70547361
## [26,] 0.4961714 0.75955779
## [27,] 1.0704229 0.70538937
## [28,] 1.0665606 1.53652256
## [29,] 0.8576982 0.68368776
## [30,] 0.9048337 0.50972738
## [31,] 1.1059506 0.58417157
## [32,] 0.6185843 0.89067995
## [33,] 0.6991913 0.79808286
## [34,] 0.9960123 1.04459145
## [35,] 0.7248793 1.21461434
## [36,] 0.6485115 0.74531737
## [37,] 0.6865702 2.06653859
## [38,] 1.3720443 1.37989624
## [39,] 0.7654984 0.39117515
## [40,] 0.9181824 0.19450205
## [41,] 0.8833812 0.43800434
## [42,] 0.7270576 1.03405294
## [43,] 1.1370848 0.66615266
## [44,] 1.1883505 0.33291741
## [45,] 0.8329991 0.63022756
## [46,] 1.6389180 1.29368240
## [47,] 1.1091709 1.44642088
## [48,] 0.8626051 1.13415358
## [49,] 0.6727378 0.29775541
## [50,] 0.7540236 0.94699259
## [51,] 1.2948698 0.60072846
## [52,] 1.0821278 1.30814165
## [53,] 0.6634536 0.92921898
## [54,] 1.7117313 1.12111093
## [55,] 1.2044264 1.60212946
## [56,] 0.3983692 2.07271673
## [57,] 1.4335465 0.68609923
## [58,] 0.7933233 0.97370990
## [59,] 1.3596580 0.54872090
## [60,] 0.5212427 0.60405034
## [61,] 2.4276767 0.50381425
## [62,] 0.8311964 0.61177094
## [63,] 0.9440198 1.24871938
## [64,] 0.8693587 0.83043156
## [65,] 0.7571041 0.94009363
## [66,] 1.3200711 1.48358679
## [67,] 1.2071022 0.81333418
## [68,] 1.6913644 0.23400602
## [69,] 1.5232310 0.68448761
## [70,] 0.9103929 2.00088576
## [71,] 1.0226445 1.21367993
## [72,] 0.7000891 0.64025648
## [73,] 0.9577893 2.96542528
## [74,] 1.1721676 0.25787068
## [75,] 0.7632987 0.50255259
## [76,] 0.4481291 1.37554545
## [77,] 0.5301690 1.32935161
## [78,] 0.5438004 0.96113542
## [79,] 1.2245687 1.00480887
## [80,] 1.3425697 1.16539396
## [81,] 1.4346142 0.81395478
## [82,] 0.5357146 0.73178799
## [83,] 0.4646478 1.39482538
## [84,] 1.0338600 0.20103554
## [85,] 1.2318376 0.53309649
## [86,] 1.4278162 1.56193582
## [87,] 0.9876451 1.17736441
## [88,] 1.0038640 0.75054459
## [89,] 0.9306942 0.61052061
## [90,] 0.5058024 0.37065754
## [91,] 1.2773585 0.80072047
## [92,] 1.8095977 1.43569996
## [93,] 0.8886464 0.81749180
## [94,] 1.4126889 1.33289093
## [95,] 0.8537487 1.46542530
## [96,] 1.4250905 1.61430385
## [97,] 0.5590967 1.47598588
## [98,] 0.5772727 0.39570557
## [99,] 0.9414336 0.54620732
## [100,] 0.9173139 0.43840347
## [101,] 0.8494978 0.91344748
## [102,] 0.6693897 0.52507013
## [103,] 0.9785745 0.24212403
## [104,] 1.2768490 1.10230997
## [105,] 1.6923405 0.50535257
## [106,] 0.8017750 0.72454356
## [107,] 0.9759563 0.60264420
## [108,] 1.0002499 0.60177872
## [109,] 2.1605397 0.74628264
## [110,] 0.7668729 1.50377636
## [111,] 1.3678465 0.65695087
## [112,] 1.0111708 0.77807982
## [113,] 1.3907041 0.82690074
## [114,] 2.0945864 1.38957574
## [115,] 0.8268589 0.40998735
## [116,] 0.8512234 0.88741968
## [117,] 1.1493096 0.37453974
## [118,] 0.8368338 0.92140749
## [119,] 0.8941160 0.49669805
## [120,] 1.1045980 1.27707675
## [121,] 1.1355305 0.88184600
## [122,] 0.7494182 0.84645776
## [123,] 0.7832868 1.14931539
## [124,] 0.7870756 0.76500126
## [125,] 1.4868575 0.62591013
## [126,] 0.6257088 0.77570584
## [127,] 1.6364940 0.52627442
## [128,] 1.2532346 0.42094543
## [129,] 0.8797567 1.57266077
## [130,] 0.9637476 0.27562028
## [131,] 1.0065799 0.59646115
## [132,] 0.8250060 1.39163654
## [133,] 0.7587916 0.48629694
## [134,] 0.6314327 0.54595731
## [135,] 0.4978865 1.05003902
## [136,] 1.7578269 0.46705476
## [137,] 1.5341907 1.13135728
## [138,] 1.1069112 1.17321597
## [139,] 1.3308945 0.72232940
## [140,] 0.9416558 0.54358818
## [141,] 0.5868192 1.06490189
## [142,] 0.9067387 0.75820803
## [143,] 0.6247024 1.01033833
## [144,] 1.3007112 0.55611813
## [145,] 1.7254602 3.76949718
## [146,] 1.8496132 0.85927673
## [147,] 0.6007502 2.92612451
## [148,] 0.8796545 2.74426045
## [149,] 1.1096345 0.70682064
## [150,] 1.0737693 1.10386367
## [151,] 1.0757663 0.70586258
## [152,] 0.6385083 0.61350673
## [153,] 0.8324614 0.60492233
## [154,] 0.7084212 0.77121246
## [155,] 0.7061088 1.33225640
## [156,] 0.6319703 1.78160058
## [157,] 0.5444726 0.45231045
## [158,] 0.8254418 1.33624554
## [159,] 0.8790325 0.91888392
## [160,] 0.9632056 1.90798352
## [161,] 0.8761582 0.59305798
## [162,] 0.9867836 0.85597094
## [163,] 0.9594905 2.00282921
## [164,] 1.0987270 1.51855522
## [165,] 0.7027390 1.31598177
## [166,] 1.1650471 0.51059873
## [167,] 1.1012450 0.53844397
## [168,] 0.7289245 0.13079052
## [169,] 0.7587166 1.65993698
## [170,] 1.1706505 0.57327600
## [171,] 0.9622410 0.58262425
## [172,] 1.1865918 0.59836542
## [173,] 0.7995650 1.26893511
## [174,] 1.1959531 0.90206686
## [175,] 1.4348018 1.45341632
## [176,] 1.4187080 0.57423428
## [177,] 0.7573428 1.51974941
## [178,] 1.4256668 1.56083232
## [179,] 0.8202219 0.83485041
## [180,] 2.0204114 0.60896545
## [181,] 0.4452253 0.94163709
## [182,] 0.8069058 0.40811547
## [183,] 2.2003770 1.82926349
## [184,] 0.6380423 0.06336439
## [185,] 2.4556574 0.90639566
## [186,] 0.8461664 0.71761586
## [187,] 0.7976387 0.75267979
## [188,] 1.2953019 1.02758954
## [189,] 0.8817248 1.06757872
## [190,] 0.8830145 0.61171677
## [191,] 1.2062946 0.81869819
## [192,] 0.5457393 1.11769757
## [193,] 0.8218400 1.33137457
## [194,] 0.9744915 0.54514069
## [195,] 0.4642856 1.60222731
## [196,] 0.6964220 1.25527516
## [197,] 1.0665010 2.57727993
## [198,] 1.4595540 0.58137005
## [199,] 0.9501021 0.85479175
## [200,] 1.4112472 1.60494058
## [201,] 0.9527302 1.04911998
## [202,] 0.8759476 0.75772681
## [203,] 1.1238591 0.53433368
## [204,] 1.7845693 0.87240561
## [205,] 1.3351444 1.01520885
## [206,] 0.8943221 1.68536444
## [207,] 1.2651042 1.04022447
## [208,] 0.6480455 0.77739199
## [209,] 0.8188243 0.82562969
## [210,] 0.9974198 1.77457674
## [211,] 0.9552638 0.32917952
## [212,] 1.3800395 0.92519000
## [213,] 0.8773666 1.04128644
## [214,] 1.3585871 1.32715546
## [215,] 1.1832065 0.40500049
## [216,] 2.4290371 3.00747708
## [217,] 0.7568413 0.65298278
## [218,] 1.3854289 0.47653782
## [219,] 0.5995089 1.13126990
## [220,] 0.7350215 0.79700349
## [221,] 1.4074362 0.99556722
## [222,] 1.1517205 2.01799015
## [223,] 1.2033030 0.45962632
## [224,] 0.9196976 0.43927856
## [225,] 0.7184122 1.75361159
## [226,] 0.9147899 0.89347861
## [227,] 0.5700812 0.66493108
## [228,] 1.0603692 0.75004298
## [229,] 0.7808317 0.97186617
## [230,] 2.3720370 1.21348070
## [231,] 0.9077988 0.61011885
## [232,] 0.8297271 0.41797258
## [233,] 1.2156567 1.26705586
## [234,] 0.6569562 0.60790032
## [235,] 0.7929955 0.32478226
## [236,] 1.5827611 0.67564057
## [237,] 0.6508602 1.08881987
## [238,] 0.7084019 0.56845903
## [239,] 0.9209952 1.73820482
## [240,] 0.9007291 0.90624828
## [241,] 1.2753751 1.15160628
## [242,] 1.0193314 0.45991797
## [243,] 1.3652420 1.92131976
## [244,] 0.8729943 0.56520493
## [245,] 1.3208438 1.80639010
## [246,] 1.3272935 0.83872711
## [247,] 0.6168708 1.47777906
## [248,] 0.9510044 0.91217270
## [249,] 0.4493032 2.20312823
## [250,] 0.6179874 1.32212299
## [251,] 1.3590644 1.12656488
## [252,] 0.9731457 1.88767303
## [253,] 1.2802273 0.29008558
## [254,] 1.0366308 0.45545114
## [255,] 1.0989088 0.59001363
## [256,] 0.9652139 0.39026655
## [257,] 0.5697119 0.14545458
## [258,] 0.8794989 1.13878406
## [259,] 0.9941396 1.10955001
## [260,] 0.5866419 0.52792694
## [261,] 0.7702102 3.24132956
## [262,] 1.1165975 0.88436922
## [263,] 1.0593075 0.70391565
## [264,] 0.6739018 1.45153418
## [265,] 1.2530799 0.99550045
## [266,] 2.1416804 0.81918782
## [267,] 1.0555720 0.67764295
## [268,] 1.1983622 0.71915149
## [269,] 1.2911884 1.74609144
## [270,] 1.6151061 0.09313189
## [271,] 0.7784865 0.52853395
## [272,] 1.0905763 0.66970934
## [273,] 0.5182288 0.29894708
## [274,] 0.5515360 0.95272641
## [275,] 1.0879602 0.20029165
## [276,] 0.8111625 2.85181425
## [277,] 0.9249009 2.21060453
## [278,] 0.7874114 1.03253716
## [279,] 0.7997458 0.96320248
## [280,] 0.7716805 0.92930299
## [281,] 1.1339441 0.97771669
## [282,] 1.0861969 1.43118910
## [283,] 0.4985113 0.98200036
## [284,] 1.4622628 0.96318416
## [285,] 0.6970669 0.61783641
## [286,] 1.3802522 0.74465641
## [287,] 0.7930293 1.14226221
## [288,] 1.0477984 1.23068930
## [289,] 0.9048497 0.86948884
## [290,] 1.5018637 0.44149960
## [291,] 0.8483172 0.92749796
## [292,] 1.2031009 0.62575168
## [293,] 1.0078362 0.62727873
## [294,] 1.5530694 1.84541194
## [295,] 0.8217704 0.31221800
## [296,] 0.9266666 2.30095215
## [297,] 0.6923621 1.78708444
## [298,] 1.3196222 0.24875726
## [299,] 1.4837293 1.31665164
## [300,] 1.0450575 1.44119579
## [301,] 1.5881798 0.57333819
## [302,] 2.2530602 0.45852514
## [303,] 1.0489039 1.12910034
## [304,] 1.2014353 1.09099611
## [305,] 1.1678815 1.03446001
## [306,] 0.9280236 0.32745907
## [307,] 0.9469262 0.87482906
## [308,] 1.4441401 1.14043863
## [309,] 0.9278026 0.25943979
## [310,] 0.9656187 0.37486330
## [311,] 1.2155658 0.81721078
## [312,] 0.9763637 0.80896730
## [313,] 0.6699811 0.70504283
## [314,] 1.3225581 0.88218295
## [315,] 1.1193837 1.22267898
## [316,] 1.3107683 0.80488429
## [317,] 1.0134305 2.53426003
## [318,] 0.5748132 0.63525504
## [319,] 0.9250030 0.26444757
## [320,] 0.4274564 1.62120278
## [321,] 0.9645912 1.50964967
## [322,] 0.7319126 0.25868600
## [323,] 0.4801227 0.91098000
## [324,] 2.0925273 0.42856494
## [325,] 0.5454439 0.77267065
## [326,] 0.6367067 1.30975592
## [327,] 0.7051312 0.90169474
## [328,] 1.0509800 1.88575764
## [329,] 0.9463732 0.66004627
## [330,] 0.4737188 0.87041296
## [331,] 0.4791260 0.67571578
## [332,] 0.7096110 0.72470254
## [333,] 1.0262225 1.05589757
## [334,] 1.4545787 1.11566333
## [335,] 1.3746948 2.69570940
## [336,] 0.8638096 0.46447502
## [337,] 0.7359249 1.20147385
## [338,] 0.9510406 2.44601185
## [339,] 0.8567110 0.74812613
## [340,] 0.4538783 0.67715222
## [341,] 0.8064142 2.39374905
## [342,] 0.5325040 0.31681492
## [343,] 0.6059713 1.68072693
## [344,] 0.5129894 0.23260171
## [345,] 0.5770360 1.00279092
## [346,] 0.6955161 2.24076421
## [347,] 0.8692698 0.67835607
## [348,] 1.0721579 1.04555349
## [349,] 1.0622063 0.60267593
## [350,] 1.1867858 0.76416882
## [351,] 0.5235165 0.36975713
## [352,] 0.7476416 0.84812085
## [353,] 1.0362303 1.14932979
## [354,] 1.0413973 0.37087420
## [355,] 0.9356644 2.46991672
## [356,] 0.9817691 0.21983639
## [357,] 1.1891461 0.76907523
## [358,] 0.5449930 1.14146956
## [359,] 1.2787050 1.25060662
## [360,] 0.6741826 0.69139335
## [361,] 1.3428736 0.98612909
## [362,] 1.0369277 1.57047633
## [363,] 1.0442655 1.17691376
## [364,] 0.9862260 0.81104901
## [365,] 1.3106057 1.51092377
## [366,] 1.0762292 0.72236742
## [367,] 0.7788773 0.28527211
## [368,] 0.6948371 0.92156322
## [369,] 0.8891961 1.06153839
## [370,] 0.8991306 0.60200510
## [371,] 1.0361145 0.47611524
## [372,] 1.2511840 0.42635882
## [373,] 0.4735197 0.73791836
## [374,] 0.7495425 2.69826495
## [375,] 0.8386330 0.46211830
## [376,] 1.1194794 0.80586176
## [377,] 0.8190778 0.63265690
## [378,] 1.7868597 0.81923202
## [379,] 0.4370508 0.73779697
## [380,] 0.9904724 0.77663149
## [381,] 1.5942182 2.39191732
## [382,] 0.5909328 1.44003588
## [383,] 1.1558016 0.71531437
## [384,] 1.2420716 1.98911622
## [385,] 1.0486854 0.54201147
## [386,] 0.8793882 0.46636705
## [387,] 0.7212862 0.57952987
## [388,] 1.3408072 0.70518708
## [389,] 0.6844432 0.63760768
## [390,] 0.7582171 1.41253216
## [391,] 0.9835858 0.50800804
## [392,] 0.6695928 0.54560010
## [393,] 1.3753437 0.79534403
## [394,] 1.1799333 0.59808712
## [395,] 0.3776088 2.69293753
## [396,] 1.6048869 0.77328606
## [397,] 1.6403856 0.48431563
## [398,] 1.0051568 0.45239149
## [399,] 0.6502159 1.63988509
## [400,] 1.2834693 1.17994600
## [401,] 1.6323934 0.55458398
## [402,] 1.1306408 3.08259460
## [403,] 1.3049774 0.99318474
## [404,] 1.4929626 0.76158886
## [405,] 1.1159322 0.54802517
## [406,] 0.6082485 1.34078536
## [407,] 0.7818627 1.01995156
## [408,] 0.2996305 0.66959392
## [409,] 1.0291275 0.64041617
## [410,] 1.0085355 0.80189667
## [411,] 1.1930176 1.58756029
## [412,] 1.9324592 0.48526915
## [413,] 1.4150626 0.97601534
## [414,] 0.5978707 1.23855252
## [415,] 0.8927730 0.73654823
## [416,] 0.7283098 0.38543465
## [417,] 1.1096915 1.04111210
## [418,] 1.6977277 0.22079894
## [419,] 0.6613468 0.55393567
## [420,] 0.4637443 0.34809016
## [421,] 1.8347773 0.57445375
## [422,] 0.9976974 1.39457804
## [423,] 0.9936128 0.57039104
## [424,] 0.5738858 0.50128241
## [425,] 1.0185559 0.58962207
## [426,] 1.2100600 1.14219864
## [427,] 0.6021663 1.62484757
## [428,] 0.7883414 1.49131412
## [429,] 1.7123881 0.73034356
## [430,] 1.2998655 0.82268291
## [431,] 0.8635527 2.74870231
## [432,] 0.8789854 0.58574768
## [433,] 0.9777007 0.90977976
## [434,] 1.2279924 2.83615752
## [435,] 0.6343620 0.20900959
## [436,] 0.7290151 0.93253540
## [437,] 1.1096396 1.57253888
## [438,] 0.5138253 1.17400737
## [439,] 0.4943325 0.49475098
## [440,] 0.9386759 0.41853313
## [441,] 0.8536399 0.48148373
## [442,] 1.3830790 0.29976302
## [443,] 1.2674906 0.97296659
## [444,] 1.0118095 1.67015422
## [445,] 1.2337121 0.75740544
## [446,] 1.3270967 0.95213584
## [447,] 1.2893304 0.32382663
## [448,] 1.3038068 0.65414972
## [449,] 1.1354910 1.08770542
## [450,] 0.5750264 1.95028247
## [451,] 0.3659664 0.57337833
## [452,] 1.3167341 1.04244823
## [453,] 0.7555778 0.29400785
## [454,] 1.1979061 1.04869793
## [455,] 1.0188591 1.50168779
## [456,] 0.4629429 0.33353049
## [457,] 0.7424867 2.83412991
## [458,] 1.2232737 0.51721296
## [459,] 1.4013792 1.94721497
## [460,] 1.6206923 0.56264042
## [461,] 1.6747391 0.63683551
## [462,] 0.4859883 0.23003339
## [463,] 0.8322083 0.85424312
## [464,] 1.2545888 0.99615837
## [465,] 0.8842160 0.30531083
## [466,] 1.1409784 0.39697967
## [467,] 0.6030078 1.11188051
## [468,] 2.2048970 0.77471576
## [469,] 0.5889052 1.48829641
## [470,] 2.5886224 0.36333824
## [471,] 1.2526403 0.43461509
## [472,] 0.8245452 1.36984009
## [473,] 1.0838086 1.13792499
## [474,] 0.9361112 0.54353960
## [475,] 0.8688240 0.55565896
## [476,] 0.4060499 0.59194386
## [477,] 0.9710405 2.49671202
## [478,] 1.3139208 1.41957614
## [479,] 1.9146875 1.45616968
## [480,] 0.4994432 0.94639097
## [481,] 0.8800673 1.55493393
## [482,] 1.5157744 0.61796633
## [483,] 0.8425570 0.47401761
## [484,] 0.7321068 2.19849811
## [485,] 0.5472572 0.51081777
## [486,] 1.0407230 2.38372065
## [487,] 1.1096732 1.62565893
## [488,] 0.6730282 0.59942545
## [489,] 1.2435684 0.88470128
## [490,] 0.7967738 0.80536744
## [491,] 0.9705434 0.39131898
## [492,] 0.9655546 0.63608616
## [493,] 1.2585213 0.57436180
## [494,] 0.6381365 1.10742101
## [495,] 0.8097455 1.47561941
## [496,] 1.7719162 1.00046745
## [497,] 1.2453687 0.49983783
## [498,] 0.7508942 0.81874849
## [499,] 1.0209315 0.61738090
## [500,] 1.1368653 1.91728456
## [501,] 0.5011164 1.39030165
## [502,] 1.8064844 1.12134919
## [503,] 1.1760467 1.85512080
## [504,] 0.8507253 1.51616366
## [505,] 0.8895043 0.83455746
## [506,] 1.2576891 0.37778685
## [507,] 1.7672161 1.41566804
## [508,] 1.3712317 0.85831711
## [509,] 1.0945026 1.18064965
## [510,] 0.9257945 0.84886866
## [511,] 1.2898340 0.92869683
## [512,] 0.6325250 0.45358502
## [513,] 0.8296497 0.68313481
## [514,] 0.8254635 1.44945558
## [515,] 0.8768776 1.60062841
## [516,] 0.9554767 1.79835086
## [517,] 1.3017945 1.75928384
## [518,] 2.0911093 0.63848958
## [519,] 1.5444883 1.34380757
## [520,] 0.6039699 0.85158291
## [521,] 1.8811454 0.53029637
## [522,] 1.9805975 0.25909401
## [523,] 1.1678681 0.34142346
## [524,] 0.7280419 0.30818675
## [525,] 0.7161124 0.24817556
## [526,] 1.3251532 0.44091137
## [527,] 0.7919363 0.89403238
## [528,] 1.0565106 0.32357897
## [529,] 0.9618632 0.36561784
## [530,] 0.9118783 0.99017878
## [531,] 1.0476244 0.61621838
## [532,] 1.3211159 0.17676101
## [533,] 0.8825703 0.67772384
## [534,] 1.9230696 1.26754786
## [535,] 0.8615293 0.46801361
## [536,] 0.8390826 1.43697246
## [537,] 0.5571635 2.24416615
## [538,] 0.9998016 1.13598181
## [539,] 0.8391906 0.43000729
## [540,] 0.6575966 0.92315512
## [541,] 0.6370076 0.82818969
## [542,] 0.8627299 1.25979912
## [543,] 0.7038532 0.83524146
## [544,] 1.5799542 2.86851705
## [545,] 1.0566548 0.84846659
## [546,] 0.9126707 1.45369264
## [547,] 0.6783207 1.62596596
## [548,] 0.6645866 0.98534636
## [549,] 1.5402527 2.38731931
## [550,] 1.2462464 2.03422941
## [551,] 0.6263645 1.50854834
## [552,] 0.3787232 1.50273490
## [553,] 0.5159910 1.65741196
## [554,] 0.9947271 1.24944718
## [555,] 0.8334947 0.46046529
## [556,] 0.8803955 0.43962521
## [557,] 0.7761163 0.84392879
## [558,] 0.6390617 0.49606685
## [559,] 0.9934388 1.86714289
## [560,] 0.6244766 1.22852501
## [561,] 1.4125059 0.74576084
## [562,] 0.5814927 0.42441772
## [563,] 1.0763925 0.57772786
## [564,] 1.0278017 0.85642273
## [565,] 1.4142757 0.96299167
## [566,] 1.1111901 0.99502727
## [567,] 0.6997281 0.92193110
## [568,] 1.3321337 1.19416840
## [569,] 0.8038019 1.95972719
## [570,] 1.2572591 0.76913058
## [571,] 1.0364351 1.51700563
## [572,] 1.1752227 1.75462404
## [573,] 0.9777432 0.56910714
## [574,] 1.7468596 1.52576851
## [575,] 0.8473146 0.89696739
## [576,] 1.3058768 1.30664285
## [577,] 0.6020831 0.87288517
## [578,] 1.2165471 1.87722922
## [579,] 0.5725004 0.75738718
## [580,] 0.5358156 0.49399335
## [581,] 0.5776643 1.12056735
## [582,] 0.4589130 0.56918749
## [583,] 0.6488621 0.77313480
## [584,] 0.2945710 1.19465999
## [585,] 0.5154530 1.89989059
## [586,] 0.9620659 0.72597629
## [587,] 0.5971028 0.40733762
## [588,] 1.6021019 1.03202929
## [589,] 0.6850908 2.04143611
## [590,] 1.7298643 1.74301446
## [591,] 1.0084730 0.48074477
## [592,] 0.6607808 0.60693426
## [593,] 1.2818256 1.03350120
## [594,] 1.4104949 1.60098299
## [595,] 1.0029575 0.53631671
## [596,] 1.1388041 0.97865915
## [597,] 1.0613728 0.60392927
## [598,] 0.5428271 0.87292971
## [599,] 1.1498801 0.91672593
## [600,] 0.7634687 1.03014234
## [601,] 1.1006643 1.19891760
## [602,] 0.7247094 0.82892436
## [603,] 0.8463543 1.60394406
## [604,] 1.4178021 0.74640662
## [605,] 0.7094948 0.58744838
## [606,] 1.1994429 0.99516077
## [607,] 0.5984724 0.52525682
## [608,] 0.4781385 1.03388389
## [609,] 1.1407192 0.67788606
## [610,] 1.0976413 0.81614757
## [611,] 0.7186841 1.27813900
## [612,] 0.9375825 1.76647922
## [613,] 1.3076992 1.20940323
## [614,] 1.1114772 1.58205862
## [615,] 1.0244919 1.21404403
## [616,] 0.8057114 1.52364809
## [617,] 0.5501905 1.01343665
## [618,] 0.8872915 0.91119413
## [619,] 0.5875576 0.57386030
## [620,] 0.9662913 1.45741388
## [621,] 0.5234654 0.88569318
## [622,] 1.9879053 1.55805741
## [623,] 0.4273141 0.98591229
## [624,] 0.9288363 0.75590725
## [625,] 1.0430224 1.09698249
## [626,] 0.7106790 0.91232321
## [627,] 0.7117909 1.18463032
## [628,] 1.1320337 1.25306998
## [629,] 1.0794326 0.49470206
## [630,] 1.0310598 0.60900339
## [631,] 0.4106447 2.44899419
## [632,] 0.7549232 1.58110397
## [633,] 0.7680536 1.03654352
## [634,] 1.4782887 1.19273806
## [635,] 1.0594967 0.45193219
## [636,] 0.8372803 0.54655539
## [637,] 0.7449142 1.53524302
## [638,] 1.2130766 0.65346711
## [639,] 0.9475708 0.29127447
## [640,] 1.6898434 0.81969656
## [641,] 0.6945667 0.51275003
## [642,] 0.9921976 1.62107432
## [643,] 0.7273593 0.51020694
## [644,] 0.5436037 0.70870935
## [645,] 1.6226218 1.76869867
## [646,] 0.4359643 1.28672268
## [647,] 1.0650340 1.17046769
## [648,] 1.7849023 0.76885580
## [649,] 1.0852849 1.54315528
## [650,] 0.8676596 1.37019879
## [651,] 1.2823285 0.78346273
## [652,] 0.5281743 0.93269746
## [653,] 0.8548616 0.59077384
## [654,] 0.7841517 0.79745489
## [655,] 0.6324755 0.67979214
## [656,] 0.5032996 0.82495977
## [657,] 0.7425036 0.73544390
## [658,] 0.4419232 1.82241787
## [659,] 1.0998716 0.14397590
## [660,] 0.6129775 0.40119525
## [661,] 1.2950501 1.81589934
## [662,] 0.7211121 0.53803770
## [663,] 2.1369296 1.11557454
## [664,] 0.5886402 1.25322495
## [665,] 0.8193793 0.97147803
## [666,] 1.2563338 0.94763304
## [667,] 0.4052561 1.70280136
## [668,] 0.6898501 0.77904046
## [669,] 1.1256815 0.75510174
## [670,] 1.0013105 1.10162390
## [671,] 1.1885268 0.35095418
## [672,] 1.0437688 0.64961976
## [673,] 0.5164231 0.56389701
## [674,] 1.1103795 0.14032892
## [675,] 1.0792449 0.68851480
## [676,] 1.2807418 0.65423039
## [677,] 0.9080067 0.83555268
## [678,] 1.2732184 1.45026856
## [679,] 1.2278235 1.05967860
## [680,] 0.8033491 0.37983504
## [681,] 0.8621185 0.37377942
## [682,] 1.3916803 0.62372401
## [683,] 0.9510572 0.79753934
## [684,] 1.2097595 1.93290206
## [685,] 0.7387934 0.65258616
## [686,] 0.9083336 0.40631049
## [687,] 1.7858129 0.71433927
## [688,] 1.1630731 0.67575548
## [689,] 1.0631393 1.09005668
## [690,] 1.3634120 0.74844915
## [691,] 0.6020650 0.86544170
## [692,] 0.9434618 0.63597772
## [693,] 0.9417930 1.74529534
## [694,] 0.8950554 0.70484629
## [695,] 1.2717949 0.60040161
## [696,] 1.6411476 0.56862474
## [697,] 0.7550055 0.72221390
## [698,] 0.9467743 1.24639684
## [699,] 0.7243142 0.88457966
## [700,] 0.6691346 1.26800566
## [701,] 1.8265119 1.84618436
## [702,] 0.4310962 0.85917146
## [703,] 0.6912873 0.38179468
## [704,] 1.5632297 0.69131080
## [705,] 1.4243364 2.01814112
## [706,] 0.7474967 0.44977271
## [707,] 0.7858051 0.52496904
## [708,] 0.7037061 1.99020695
## [709,] 1.1885453 0.85933372
## [710,] 0.7187325 0.64265472
## [711,] 0.6987315 0.46827041
## [712,] 0.6456257 1.02669676
## [713,] 1.5223893 0.62931991
## [714,] 1.4639393 2.34608213
## [715,] 0.7985590 0.48317761
## [716,] 1.1260010 0.46501809
## [717,] 0.9752521 0.52883386
## [718,] 0.5467846 1.05984601
## [719,] 1.0910356 0.60054079
## [720,] 1.4309453 0.34916593
## [721,] 1.1885053 0.96183007
## [722,] 1.1494582 0.44031828
## [723,] 1.3952688 0.36728619
## [724,] 0.8643072 1.11297150
## [725,] 0.7352781 2.18755207
## [726,] 1.4293788 1.29300805
## [727,] 0.9796313 1.40480549
## [728,] 1.0879301 1.48087852
## [729,] 1.3767983 1.19688283
## [730,] 1.1949709 2.11815149
## [731,] 0.9975225 0.66488968
## [732,] 0.7954696 1.55443589
## [733,] 1.6352104 0.86133837
## [734,] 0.6389689 0.51644985
## [735,] 1.7896382 0.52418406
## [736,] 1.5249444 0.50931589
## [737,] 0.9487864 0.89319903
## [738,] 1.1727452 0.85668633
## [739,] 1.4525970 0.60966737
## [740,] 0.9818218 1.00395726
## [741,] 0.4995535 1.15306158
## [742,] 1.3377717 0.53024957
## [743,] 1.7633646 0.88054673
## [744,] 0.9746033 2.26111598
## [745,] 2.0145143 0.49706601
## [746,] 0.7628759 0.57086445
## [747,] 1.3903321 0.66314794
## [748,] 0.8184021 2.61761684
## [749,] 0.6468814 1.22739916
## [750,] 0.7221048 1.14572159
## [751,] 0.6778350 1.09019191
## [752,] 0.7737182 0.67746365
## [753,] 0.8250871 0.62662020
## [754,] 0.7973497 0.71964946
## [755,] 1.3792766 1.20972266
## [756,] 0.6908723 0.34581816
## [757,] 0.5825846 0.73128729
## [758,] 1.7203935 0.75935544
## [759,] 1.4875519 1.95265110
## [760,] 0.4373645 1.18030554
## [761,] 0.8063508 0.70034022
## [762,] 0.8367104 0.49314855
## [763,] 1.5905844 0.55764594
## [764,] 1.1438443 3.01986870
## [765,] 0.2841873 1.35660523
## [766,] 1.0137838 0.41014650
## [767,] 1.0201531 0.39910477
## [768,] 0.5912619 1.09062953
## [769,] 0.9248278 0.44275378
## [770,] 2.0231704 1.14027780
## [771,] 1.3744303 1.17862119
## [772,] 0.6218851 0.74607233
## [773,] 1.3947507 1.91763870
## [774,] 1.0624490 0.45786456
## [775,] 1.2171334 0.65429678
## [776,] 0.9112459 0.90925744
## [777,] 0.5501560 0.34284113
## [778,] 1.4444739 0.97738427
## [779,] 0.6607755 0.77851654
## [780,] 0.9355840 0.68749926
## [781,] 0.7720902 1.08738575
## [782,] 0.5540686 0.64576045
## [783,] 0.7343690 0.85367190
## [784,] 0.8053576 1.99177597
## [785,] 0.8275413 0.76420150
## [786,] 0.5915460 0.63439792
## [787,] 1.4450958 0.39257175
## [788,] 0.7472752 2.09360366
## [789,] 0.5659104 0.88242963
## [790,] 0.7113652 0.67468439
## [791,] 1.0987773 0.54209322
## [792,] 1.0168737 1.21397778
## [793,] 0.9815011 1.36168187
## [794,] 0.9111127 1.77159460
## [795,] 0.7853865 2.65120718
## [796,] 0.7439834 1.00007673
## [797,] 1.1807579 1.12847172
## [798,] 0.5825301 0.83793180
## [799,] 1.4374655 0.54256252
## [800,] 0.2341707 0.44692063
## [801,] 0.6506230 2.09355201
## [802,] 0.9233780 0.58991762
## [803,] 1.0320037 0.80154485
## [804,] 0.7510482 0.94795953
## [805,] 0.9809148 0.99198222
## [806,] 0.6086734 0.79874721
## [807,] 0.4780112 0.24551851
## [808,] 1.1935265 0.63784999
## [809,] 0.9470229 1.33299449
## [810,] 1.1572502 1.06693746
## [811,] 1.4001830 1.02640044
## [812,] 1.7494934 1.14676430
## [813,] 0.7814547 1.59877421
## [814,] 1.3258403 1.07857774
## [815,] 1.0529616 0.95964382
## [816,] 0.7723082 1.19247455
## [817,] 0.6685899 0.92744496
## [818,] 1.3326788 1.19043075
## [819,] 1.2432429 1.35875257
## [820,] 1.0567257 0.62099867
## [821,] 1.4881288 1.40307049
## [822,] 0.8164492 0.99689644
## [823,] 0.7235489 0.65916750
## [824,] 1.0467624 0.50642277
## [825,] 0.9330771 0.66513743
## [826,] 0.8575653 0.69179387
## [827,] 0.7956086 1.28162132
## [828,] 1.1333685 0.61529698
## [829,] 0.3398019 1.63123411
## [830,] 1.6130054 0.96828999
## [831,] 0.9902907 1.29325304
## [832,] 0.6443441 1.61475324
## [833,] 1.1716012 0.77865967
## [834,] 2.2056364 3.31124289
## [835,] 1.1114880 1.43478370
## [836,] 0.4044744 0.67507689
## [837,] 0.3662661 0.93107404
## [838,] 0.7900226 1.04435875
## [839,] 1.2502219 0.52260345
## [840,] 1.1874166 0.80911825
## [841,] 1.4756422 0.41386484
## [842,] 0.7305213 1.34478614
## [843,] 1.2521084 1.28578468
## [844,] 0.6747649 0.62895540
## [845,] 0.6684411 0.63888809
## [846,] 0.9945855 0.34464098
## [847,] 0.7078375 1.01303760
## [848,] 1.0272806 0.51460278
## [849,] 0.4943109 0.75000906
## [850,] 1.0054646 0.60513300
## [851,] 1.1870597 0.90577810
## [852,] 1.6487235 2.44530709
## [853,] 0.5899071 0.88819564
## [854,] 0.5641276 1.07606432
## [855,] 1.0878078 0.76339537
## [856,] 0.6400801 1.10244305
## [857,] 1.2849136 0.85729217
## [858,] 0.7733474 0.38718272
## [859,] 0.9275930 1.14315678
## [860,] 1.1884730 1.92877463
## [861,] 1.8444296 0.41990949
## [862,] 1.3878331 0.68392899
## [863,] 1.4189217 0.48663659
## [864,] 1.3442557 1.11974910
## [865,] 0.7289680 1.89765322
## [866,] 1.0414667 1.69318049
## [867,] 0.5080458 0.96241918
## [868,] 1.0386361 0.38583276
## [869,] 1.0328625 0.69719942
## [870,] 0.8300911 1.53083184
## [871,] 0.5275817 0.28479788
## [872,] 1.1771630 0.57445141
## [873,] 0.9786564 0.56578552
## [874,] 1.7181658 1.42983625
## [875,] 0.7504376 2.45515657
## [876,] 1.1511286 1.02919632
## [877,] 1.4503957 0.25924307
## [878,] 1.2953661 1.53373391
## [879,] 1.3093036 0.89668849
## [880,] 0.8730249 0.21270440
## [881,] 0.4132428 0.74400394
## [882,] 1.3073455 0.86524090
## [883,] 1.2783786 0.96990125
## [884,] 1.7189732 0.83852578
## [885,] 0.4689267 0.39850259
## [886,] 0.8529474 0.59931682
## [887,] 1.5807995 1.68696611
## [888,] 1.3846840 0.85536632
## [889,] 0.7653004 1.17507153
## [890,] 0.8005231 0.60319931
## [891,] 1.0443758 0.68569901
## [892,] 0.9022642 0.90229503
## [893,] 1.6474776 1.32266733
## [894,] 0.5769356 0.92035017
## [895,] 0.9205599 1.68539727
## [896,] 1.1169560 1.65563885
## [897,] 1.1703504 1.63481394
## [898,] 0.9433387 0.84435622
## [899,] 1.5700774 2.05915272
## [900,] 0.5103778 2.47063935
## [901,] 0.8165891 1.74671977
## [902,] 0.9563328 0.84810013
## [903,] 1.1152884 0.42822919
## [904,] 0.9014495 1.17845019
## [905,] 1.2639391 1.42396750
## [906,] 1.1132272 0.91119801
## [907,] 1.0242571 0.61322363
## [908,] 0.9528733 2.13188902
## [909,] 1.6026519 0.88903657
## [910,] 2.3185668 1.27991923
## [911,] 1.7102059 0.69463190
## [912,] 1.2219245 1.00241555
## [913,] 1.9317519 0.33179168
## [914,] 1.5246721 1.50861572
## [915,] 1.1516693 1.73348056
## [916,] 1.4869295 0.90446292
## [917,] 0.7934459 1.29787576
## [918,] 0.6033807 1.54647986
## [919,] 0.8405655 0.96203921
## [920,] 0.8715474 1.23156805
## [921,] 1.0119780 0.59213823
## [922,] 0.6861455 1.86219803
## [923,] 0.5800616 1.56916438
## [924,] 1.1861209 1.16089837
## [925,] 0.4441103 0.58861481
## [926,] 1.0922560 1.61917069
## [927,] 0.6705104 1.20220169
## [928,] 0.9024731 0.93059777
## [929,] 1.4231584 0.80809837
## [930,] 0.5917916 1.55983953
## [931,] 0.4540764 0.47762259
## [932,] 0.7139885 0.26862777
## [933,] 0.7248169 1.18963202
## [934,] 1.1930092 1.24761860
## [935,] 1.1839703 0.66426775
## [936,] 1.3083586 0.38386306
## [937,] 1.0869710 2.12349293
## [938,] 1.1051591 0.79303379
## [939,] 0.7065753 0.59149929
## [940,] 0.8832342 0.77663087
## [941,] 2.3489447 1.09547253
## [942,] 1.8796986 0.76986157
## [943,] 0.5377288 0.66055100
## [944,] 1.6649575 0.49117070
## [945,] 0.3645697 0.56779945
## [946,] 1.1908307 0.79261738
## [947,] 1.5123023 0.77817550
## [948,] 1.1545685 0.20222698
## [949,] 1.3073756 0.38167288
## [950,] 1.0973746 1.29489714
## [951,] 0.8656605 1.23684728
## [952,] 1.5462928 0.41709378
## [953,] 0.8012865 0.76982426
## [954,] 1.1562741 1.22055689
## [955,] 0.7697570 0.73795419
## [956,] 1.1633787 0.41263616
## [957,] 0.7009468 1.15865137
## [958,] 0.4468276 1.54126677
## [959,] 2.4843511 1.03519425
## [960,] 1.8307739 2.08867707
## [961,] 0.6163693 0.48967731
## [962,] 0.9543267 1.42262614
## [963,] 1.2408311 0.76107165
## [964,] 0.7479350 0.27909635
## [965,] 0.6565244 1.39416971
## [966,] 1.5371872 0.63300376
## [967,] 0.7794417 0.74070901
## [968,] 1.0814986 1.01284915
## [969,] 1.1207814 0.91505023
## [970,] 0.5921985 1.09765927
## [971,] 0.7372821 1.47180558
## [972,] 1.7217583 0.61259361
## [973,] 1.3943502 0.37216583
## [974,] 1.0182351 2.24566208
## [975,] 1.2159514 1.06398664
## [976,] 0.9590406 1.27707306
## [977,] 1.6726122 0.86946675
## [978,] 0.7686981 1.25709643
## [979,] 1.1080842 1.12035769
## [980,] 0.9688584 1.16554433
## [981,] 0.7679443 0.77799925
## [982,] 0.5505194 0.70070943
## [983,] 0.9193700 0.77051475
## [984,] 1.4331346 1.09059326
## [985,] 0.8144657 0.30220522
## [986,] 1.3063817 0.75916761
## [987,] 0.6904087 1.30162151
## [988,] 1.0406141 1.67277046
## [989,] 0.6368910 0.23921301
## [990,] 0.5275752 1.85854877
## [991,] 1.0498785 0.85569321
## [992,] 1.7705836 1.38146333
## [993,] 0.6349770 1.54318538
## [994,] 1.4419994 2.09199090
## [995,] 0.6041639 1.04849045
## [996,] 0.7518335 0.78151582
## [997,] 0.7177718 0.35432324
## [998,] 0.9023603 0.51616967
## [999,] 0.8508526 1.30839911
##
## $model.matrix
## (Intercept) factor1 factor2 shrub_density
## 1 1 1 0 11
## 2 1 1 0 14
## 3 1 0 1 13
## 4 1 1 0 12
## 5 1 0 1 12
## 6 1 1 0 8
## 7 1 0 1 10
## 8 1 1 0 9
## 9 1 0 1 10
## 10 1 -1 -1 5
## 11 1 -1 -1 10
## 12 1 0 1 9
## 13 1 -1 -1 12
## 14 1 0 1 12
## 15 1 1 0 10
## 16 1 0 1 16
## 17 1 1 0 22
## 18 1 0 1 22
## 19 1 1 0 30
## 20 1 0 1 28
## 21 1 1 0 26
## 22 1 0 1 28
## 23 1 1 0 28
## 24 1 -1 -1 24
## 25 1 0 1 28
## 26 1 -1 -1 18
## 27 1 0 1 12
## 28 1 1 0 8
## 29 1 0 1 8
## 30 1 1 0 5
## 31 1 0 1 6
## 32 1 1 0 7
## 33 1 0 1 6
## 34 1 1 0 3
## 35 1 0 1 1
## 36 1 1 0 1
## 37 1 0 1 0
## 38 1 -1 -1 9
## 39 1 0 1 8
## 40 1 -1 -1 10
## 41 1 0 1 8
## 42 1 -1 -1 11
## 43 1 0 1 10
## 44 1 1 0 0
## 45 1 0 1 0
## 46 1 1 0 0
## 47 1 0 1 0
## 48 1 1 0 0
## 49 1 0 1 0
## 50 1 1 0 0
## 51 1 0 1 0
## 52 1 1 0 0
## 53 1 0 1 0
##
## $terms
## pca_data_final ~ factor + shrub_density
## attr(,"variables")
## list(pca_data_final, factor, shrub_density)
## attr(,"factors")
## factor shrub_density
## pca_data_final 0 0
## factor 1 0
## shrub_density 0 1
## attr(,"term.labels")
## [1] "factor" "shrub_density"
## attr(,"order")
## [1] 1 1
## attr(,"intercept")
## [1] 1
## attr(,"response")
## [1] 1
## attr(,".Environment")
## <environment: R_GlobalEnv>
##
## attr(,"class")
## [1] "adonis"
dist_final <- vegdist(pca_data_final, species = "bray")
res_final <- pcoa(dist_final)
p02 <- as.data.frame(res_final$vectors)%>%
dplyr::select(Axis.1, Axis.2) %>%
bind_cols(env_final,.)
pcoa_final <- ggplot(p02, aes(Axis.1, Axis.2, group = factor)) +
geom_point(aes(color = factor)) +
geom_text(aes(label=site.number), hjust = 0, vjust = 0, check_overlap = TRUE, nudge_x = 0.01)+
scale_color_brewer(palette = "Paired") + theme_classic() + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) +
labs(color = "Microsite") + theme(aspect.ratio = 1)
pcoa_final
model020 <- betadisper(dist_final, env_final$factor)
model020
##
## Homogeneity of multivariate dispersions
##
## Call: betadisper(d = dist_final, group = env_final$factor)
##
## No. of Positive Eigenvalues: 29
## No. of Negative Eigenvalues: 21
##
## Average distance to median:
## mimic open shrub
## 0.5574 0.5262 0.5339
##
## Eigenvalues for PCoA axes:
## (Showing 8 of 50 eigenvalues)
## PCoA1 PCoA2 PCoA3 PCoA4 PCoA5 PCoA6 PCoA7 PCoA8
## 4.6259 3.6419 2.1983 1.7025 1.5594 0.8852 0.6750 0.4914
anova(model020)
## Analysis of Variance Table
##
## Response: Distances
## Df Sum Sq Mean Sq F value Pr(>F)
## Groups 2 0.01109 0.0055448 0.2288 0.7963
## Residuals 50 1.21160 0.0242320
permutest(model020,pairwise = TRUE, permutations = 99)
##
## Permutation test for homogeneity of multivariate dispersions
## Permutation: free
## Number of permutations: 99
##
## Response: Distances
## Df Sum Sq Mean Sq F N.Perm Pr(>F)
## Groups 2 0.01109 0.0055448 0.2288 99 0.83
## Residuals 50 1.21160 0.0242320
##
## Pairwise comparisons:
## (Observed p-value below diagonal, permuted p-value above diagonal)
## mimic open shrub
## mimic 0.49000 0.68
## open 0.51802 0.91
## shrub 0.64556 0.91398
model020.HSD <- TukeyHSD(model020)
model020.HSD
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = distances ~ group, data = df)
##
## $group
## diff lwr upr p adj
## open-mimic -0.031224995 -0.1440249 0.08157493 0.7826750
## shrub-mimic -0.023489283 -0.1807813 0.13380270 0.9308934
## shrub-open 0.007735711 -0.1449961 0.16046753 0.9917840
boxplot(model020)
### Clean up and add abundance to df
library(stringr)
photo <- read.csv("observations.csv")
colnames(tidy_20m)[4] <- "microsite_number"
tidy_20m <- tidy_20m %>%
mutate(factor = str_to_title(factor))
df <- merge(Total_Observations_factors, tidy_20m, by = c("site_code", "factor", "microsite_number"))
colnames(df)[4] <- "abundance"
colnames(df)[5] <- "rep"
colnames(df)[10] <- "shrub_density"
df <- df %>%
dplyr::select(-functioned)
df <- df %>%
dplyr::select(rep, everything())
df <- df %>%
dplyr::select(-abundance, everything())
### Calculate Richness across the tested sites
density_simple_2023 <- animals_density_final %>%
group_by(site_code, factor, microsite_number) %>%
summarise(animals = sum(captures), richness = n())
## `summarise()` has grouped output by 'site_code', 'factor'. You can override
## using the `.groups` argument.
richness <- density_simple_2023 %>%
dplyr::select(-animals)
df <- merge(df, richness, by = c("site_code", "factor", "microsite_number"))
### Evenness Data
evenness_results <- animals_density_final %>%
group_by(site_code, factor, microsite_number) %>%
summarize(evenness = diversity(captures, index = "shannon")) ### This worked 100x better than Vegan!!!
## `summarise()` has grouped output by 'site_code', 'factor'. You can override
## using the `.groups` argument.
df <- merge(df, evenness_results, by = c("site_code", "factor", "microsite_number"))
#write.csv(df, file = "Dataframe.csv")
df <- read.csv("Dataframe.csv")
### Handheld Temp Data
handheld_temp <- read.csv("Chapter5_Temp_Data.csv")
colnames(handheld_temp)[5] <- "microsite_number"
colnames(handheld_temp)[8] <- "ground_temp"
handheld_temp <- handheld_temp %>%
group_by(site_code, factor, microsite_number ) %>%
summarise(mean_ambient_temp = mean(temp), mean_rh = mean(rh), mean_ground_temp = mean(ground_temp))
## `summarise()` has grouped output by 'site_code', 'factor'. You can override
## using the `.groups` argument.
handheld_temp <- handheld_temp %>%
mutate(factor = str_to_title(factor))
df <- merge(df, handheld_temp, by = c("site_code", "factor", "microsite_number"))
colnames(df)[7] <- "pendant_ID"
colnames(df)[8] <- "shrub_density"
### Pendant Temp and test if temp is significant compared across factors
library(emmeans)
pendant_temp <- read.csv("Temp_Final.csv")
pendant_temp <- pendant_temp %>%
group_by(site_code, factor, microsite_number) %>%
summarise(mean_pendant_temp = mean(temp))
## `summarise()` has grouped output by 'site_code', 'factor'. You can override
## using the `.groups` argument.
anova_result <- aov(mean_pendant_temp ~ factor, data = pendant_temp) ### Temp is significant.
print(summary(anova_result))
## Df Sum Sq Mean Sq F value Pr(>F)
## factor 2 13.87 6.937 4.836 0.0187 *
## Residuals 21 30.12 1.434
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans_result <- emmeans(anova_result, pairwise ~ factor) ### Mimic Significantly cooler than open areas!
print(emmeans_result)
## $emmeans
## factor emmean SE df lower.CL upper.CL
## Mimic 18.4 0.423 21 17.6 19.3
## Open 20.4 0.453 21 19.4 21.3
## Shrub 19.5 0.399 21 18.7 20.4
##
## Confidence level used: 0.95
##
## $contrasts
## contrast estimate SE df t.ratio p.value
## Mimic - Open -1.911 0.620 21 -3.083 0.0149
## Mimic - Shrub -1.100 0.582 21 -1.889 0.1665
## Open - Shrub 0.811 0.604 21 1.344 0.3875
##
## P value adjustment: tukey method for comparing a family of 3 estimates
### Final Data Frame
#write.csv(df, file = "tidy_mimic_experiment.csv")
### use df as final dataframe since it has all required data.
### First check if temp sig varies based off handheld logger.
df <- read.csv("tidy_mimic_2023.csv")
supp1.1 <- ggplot(df, aes(x = microsite, y = mean_ambient_temp, fill = microsite)) +
geom_boxplot() + stat_summary(fun = mean, geom = "point", shape = 18, size = 2, fill = "black", position = position_dodge(width = 0.75 )) +
labs(
x = "Microsite",
y = "Ambient Temperature (°C)") + theme_classic() + labs(tag = "A", x = NULL) +
scale_fill_manual(values = c("mimic" = "#a6cee3", "open" = "#1f78b4", "shrub" = "#b2df8a")) + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) + theme(legend.position = "none") + theme(aspect.ratio = 1)
supp1.1
ambient_anova_result <- aov(mean_ambient_temp ~ microsite, data = df) ### Temp from handheld not significant
print(summary(ambient_anova_result))
## Df Sum Sq Mean Sq F value Pr(>F)
## microsite 2 1.4 0.700 0.208 0.813
## Residuals 55 185.2 3.367
### Check Ground temp
supp1.2 <- ggplot(df, aes(x = microsite, y = mean_ground_temp, fill = microsite)) +
geom_boxplot() + stat_summary(fun = mean, geom = "point", shape = 18, size = 2, position = position_dodge(width = 0.75 )) + labs(
x = "Microsite",
y = "Ground Temperature (°C)") + theme_classic() + labs(tag = "B") +
scale_fill_manual(values = c("mimic" = "#a6cee3", "open" = "#1f78b4", "shrub" = "#b2df8a")) + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) + theme(legend.position = "none") + theme(aspect.ratio = 1)
supp1.2
ground_anova_result <- aov(mean_ground_temp ~ microsite, data = df) ### Ground temp significantly varied
print(summary(ground_anova_result))
## Df Sum Sq Mean Sq F value Pr(>F)
## microsite 2 1050 525.2 26.56 8.46e-09 ***
## Residuals 55 1088 19.8
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ground_emmeans_result <- emmeans(ground_anova_result, pairwise ~ microsite)
print(ground_emmeans_result)
## $emmeans
## microsite emmean SE df lower.CL upper.CL
## mimic 34.5 0.994 55 32.5 36.4
## open 34.9 0.826 55 33.3 36.6
## shrub 23.0 1.482 55 20.0 26.0
##
## Confidence level used: 0.95
##
## $contrasts
## contrast estimate SE df t.ratio p.value
## mimic - open -0.496 1.29 55 -0.384 0.9222
## mimic - shrub 11.444 1.78 55 6.412 <.0001
## open - shrub 11.940 1.70 55 7.037 <.0001
##
## P value adjustment: tukey method for comparing a family of 3 estimates
### Now Humidity
ggplot(df, aes(x = microsite, y = mean_rh)) +
geom_boxplot() +
labs(
x = "Factor",
y = "Relative Humidity") + theme_classic()
rh_anova_result <- aov(mean_rh ~ microsite, data = df) ### Ground temp significantly varied
print(summary(rh_anova_result))
## Df Sum Sq Mean Sq F value Pr(>F)
## microsite 2 10.9 5.46 0.551 0.58
## Residuals 55 545.1 9.91
Supp1 <- (supp1.1 / supp1.2) + plot_layout(guides = 'collect')
print(Supp1)
### Final findings from temp data so far. Loggers indicate that mimics were cooler than open areas and not significantly different from shrubs. Handheld ambient indicate no significance. Handheld ground indicates that the temperature under shrubs is cooler than mimic and open, with no signifiacne between open and mimics. Finally RH is not signicant across any of the factors.
### Now we test abundance with the factors.
# df now has factor = microsite and site_code has been edited to match regional.csv
library(AER) ### For testing overdispersion
## Loading required package: car
## Loading required package: carData
##
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
##
## recode
## The following object is masked from 'package:purrr':
##
## some
## Loading required package: lmtest
## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
## Loading required package: sandwich
## Loading required package: survival
plot2.1 <- ggplot(df, aes(x = microsite, y = abundance, fill = microsite)) +
geom_boxplot() + stat_summary(fun = mean, geom = "point", shape = 18, size = 2, position = position_dodge(width = 0.75 )) +
labs(
x = "Microsite",
y = "Abundance") + theme_classic() + labs(tag = "A", x = NULL)+
scale_fill_manual(values = c("mimic" = "#a6cee3", "open" = "#1f78b4", "shrub" = "#b2df8a")) + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) + theme(aspect.ratio = 0.7) + theme(legend.position = "none") + theme(legend.text = element_text(size = 8))
plot2.1
hist(df$abundance, main = "Histogram of Response Variable") ### data is skewed.
shapiro.test(df$abundance)
##
## Shapiro-Wilk normality test
##
## data: df$abundance
## W = 0.56434, p-value = 7.41e-12
model1 <- glm(abundance~microsite + mean_ambient_temp + shrub_density, family = "poisson", data = df)
model1
##
## Call: glm(formula = abundance ~ microsite + mean_ambient_temp + shrub_density,
## family = "poisson", data = df)
##
## Coefficients:
## (Intercept) micrositeopen micrositeshrub mean_ambient_temp
## 3.79435 -0.57841 -0.10553 0.03792
## shrub_density
## -0.11226
##
## Degrees of Freedom: 57 Total (i.e. Null); 53 Residual
## Null Deviance: 4372
## Residual Deviance: 3065 AIC: 3305
anova(model1, test = "Chisq")
## Analysis of Deviance Table
##
## Model: poisson, link: log
##
## Response: abundance
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 4372.1
## microsite 2 241.77 55 4130.4 < 2.2e-16 ***
## mean_ambient_temp 1 14.07 54 4116.3 0.0001763 ***
## shrub_density 1 1051.79 53 3064.5 < 2.2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
abundance_emmeans_result <- emmeans(model1, pairwise ~ microsite)
print(abundance_emmeans_result)
## $emmeans
## microsite emmean SE df asymp.LCL asymp.UCL
## mimic 3.48 0.0418 Inf 3.40 3.57
## open 2.91 0.0437 Inf 2.82 2.99
## shrub 3.38 0.0650 Inf 3.25 3.51
##
## Results are given on the log (not the response) scale.
## Confidence level used: 0.95
##
## $contrasts
## contrast estimate SE df z.ratio p.value
## mimic - open 0.578 0.0473 Inf 12.239 <.0001
## mimic - shrub 0.106 0.0769 Inf 1.373 0.3553
## open - shrub -0.473 0.0779 Inf -6.069 <.0001
##
## Results are given on the log (not the response) scale.
## P value adjustment: tukey method for comparing a family of 3 estimates
dispersion_test_abundance <- dispersiontest(model1)
print(dispersion_test_abundance)
##
## Overdispersion test
##
## data: model1
## z = 2.1079, p-value = 0.01752
## alternative hypothesis: true dispersion is greater than 1
## sample estimates:
## dispersion
## 80.94488
### Richness Data
plot2.2 <- ggplot(df, aes(x = microsite, y = richness, fill = microsite)) +
geom_boxplot() + stat_summary(fun = mean, geom = "point", shape = 18, size = 2, position = position_dodge(width = 0.75 )) +
labs(
x = "Microsite",
y = "Richness") + theme_classic() + labs(tag = "B", x = NULL)+
scale_fill_manual(values = c("mimic" = "#a6cee3", "open" = "#1f78b4", "shrub" = "#b2df8a")) + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) + theme(aspect.ratio = 0.7) + theme(legend.position = "none") + theme(legend.text = element_text(size = 8))
plot2.2
hist(df$richness, main = "Histogram of Response Variable") ### data is skewed.
shapiro.test(df$richness)
##
## Shapiro-Wilk normality test
##
## data: df$richness
## W = 0.93675, p-value = 0.004686
model2 <- glm(richness~microsite + mean_ambient_temp + shrub_density, family = "poisson", data = df)
model2
##
## Call: glm(formula = richness ~ microsite + mean_ambient_temp + shrub_density,
## family = "poisson", data = df)
##
## Coefficients:
## (Intercept) micrositeopen micrositeshrub mean_ambient_temp
## 0.68567 -0.51958 -0.46319 0.04118
## shrub_density
## -0.02223
##
## Degrees of Freedom: 57 Total (i.e. Null); 53 Residual
## Null Deviance: 93.5
## Residual Deviance: 73.72 AIC: 238.7
anova(model2, test = "Chisq")
## Analysis of Deviance Table
##
## Model: poisson, link: log
##
## Response: richness
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 93.497
## microsite 2 12.1743 55 81.322 0.002272 **
## mean_ambient_temp 1 1.8426 54 79.480 0.174641
## shrub_density 1 5.7622 53 73.718 0.016374 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
richness_emmeans_result <- emmeans(model2, pairwise ~ microsite)
print(richness_emmeans_result)
## $emmeans
## microsite emmean SE df asymp.LCL asymp.UCL
## mimic 1.398 0.112 Inf 1.179 1.62
## open 0.879 0.119 Inf 0.645 1.11
## shrub 0.935 0.214 Inf 0.516 1.35
##
## Results are given on the log (not the response) scale.
## Confidence level used: 0.95
##
## $contrasts
## contrast estimate SE df z.ratio p.value
## mimic - open 0.5196 0.161 Inf 3.226 0.0036
## mimic - shrub 0.4632 0.243 Inf 1.903 0.1379
## open - shrub -0.0564 0.246 Inf -0.229 0.9714
##
## Results are given on the log (not the response) scale.
## P value adjustment: tukey method for comparing a family of 3 estimates
dispersion_test_richness <- dispersiontest(model2)
print(dispersion_test_richness) ### Non sig p-value so should be good
##
## Overdispersion test
##
## data: model2
## z = 0.78055, p-value = 0.2175
## alternative hypothesis: true dispersion is greater than 1
## sample estimates:
## dispersion
## 1.119264
### Evenness
plot2.3 <- ggplot(df, aes(x = microsite, y = evenness, fill = microsite )) +
geom_boxplot() + stat_summary(fun = mean, geom = "point", shape = 18, size = 2, position = position_dodge(width = 0.75 )) +
labs(
x = "Microsite",
y = "Evenness") + theme_classic() + labs(tag = "C") +
scale_fill_manual(values = c("mimic" = "#a6cee3", "open" = "#1f78b4", "shrub" = "#b2df8a")) + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) + theme(aspect.ratio = 0.7) + theme(legend.position = "none") + theme(legend.text = element_text(size = 8))
plot2.3
hist(df$evenness, main = "Histogram of Response Variable") ### data is skewed.
shapiro.test(df$evenness)
##
## Shapiro-Wilk normality test
##
## data: df$evenness
## W = 0.91115, p-value = 0.0004352
model3 <- glm(evenness~microsite + mean_ambient_temp + shrub_density, family = "poisson", data = df)
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
model3
##
## Call: glm(formula = evenness ~ microsite + mean_ambient_temp + shrub_density,
## family = "poisson", data = df)
##
## Coefficients:
## (Intercept) micrositeopen micrositeshrub mean_ambient_temp
## -0.445437 -0.545571 -1.070068 0.010256
## shrub_density
## 0.002026
##
## Degrees of Freedom: 57 Total (i.e. Null); 53 Residual
## Null Deviance: 29.23
## Residual Deviance: 25.21 AIC: Inf
anova(model3, test = "Chisq")
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
## Analysis of Deviance Table
##
## Model: poisson, link: log
##
## Response: evenness
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 29.230
## microsite 2 4.0028 55 25.227 0.1351
## mean_ambient_temp 1 0.0103 54 25.216 0.9190
## shrub_density 1 0.0106 53 25.206 0.9181
evenness_emmeans_result <- emmeans(model3, pairwise ~ microsite)
print(evenness_emmeans_result)
## $emmeans
## microsite emmean SE df asymp.LCL asymp.UCL
## mimic -0.188 0.247 Inf -0.672 0.2958
## open -0.734 0.268 Inf -1.259 -0.2083
## shrub -1.258 0.626 Inf -2.484 -0.0322
##
## Results are given on the log (not the response) scale.
## Confidence level used: 0.95
##
## $contrasts
## contrast estimate SE df z.ratio p.value
## mimic - open 0.546 0.365 Inf 1.495 0.2935
## mimic - shrub 1.070 0.674 Inf 1.588 0.2509
## open - shrub 0.524 0.680 Inf 0.771 0.7209
##
## Results are given on the log (not the response) scale.
## P value adjustment: tukey method for comparing a family of 3 estimates
dispersion_test_evenness <- dispersiontest(model3)
print(dispersion_test_evenness)
##
## Overdispersion test
##
## data: model3
## z = -6.1775, p-value = 1
## alternative hypothesis: true dispersion is greater than 1
## sample estimates:
## dispersion
## 0.3522632
Fig2 <- (plot2.1 / plot2.2 / plot2.3) + plot_layout(guides = 'collect')
print(Fig2)
### Abundance v Shrub Density (Shrub density on its own is significant but not between microsites)
model7 <- glm(abundance~microsite*shrub_density, data = df) ### It is NOT poisson for this distribution! It is gaussian!
model7 ### Need to run the model this way because the figures show that microsite and temp interaction is not significant.
##
## Call: glm(formula = abundance ~ microsite * shrub_density, data = df)
##
## Coefficients:
## (Intercept) micrositeopen
## 94.682 -52.430
## micrositeshrub shrub_density
## -39.787 -4.256
## micrositeopen:shrub_density micrositeshrub:shrub_density
## 2.792 2.059
##
## Degrees of Freedom: 57 Total (i.e. Null); 52 Residual
## Null Deviance: 256400
## Residual Deviance: 208400 AIC: 653.4
anova(model7, test = "Chisq")
## Analysis of Deviance Table
##
## Model: gaussian, link: identity
##
## Response: abundance
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 256391
## microsite 2 9191.4 55 247199 0.317706
## shrub_density 1 31068.7 54 216131 0.005366 **
## microsite:shrub_density 2 7715.0 52 208416 0.381954
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
abundance_density <- ggplot(df, aes(shrub_density, abundance, color = microsite)) +
geom_point(size = 0.5) +
scale_color_brewer(palette = "Paired") +
labs(x = "Shrub Density", y = "Abundance") + theme_classic() + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) +
geom_smooth(method = lm, se = TRUE) + labs(tag = "A", x = NULL) + theme(legend.position = "none") + theme(aspect.ratio = 0.8)
abundance_density
## `geom_smooth()` using formula = 'y ~ x'
### richness v density (Again, significant shrub density but not the interactio with microsite!)
model8 <- glm(richness~microsite*shrub_density, data = df) ### It is NOT poisson for this distribution! It is gaussian!
model8
##
## Call: glm(formula = richness ~ microsite * shrub_density, data = df)
##
## Coefficients:
## (Intercept) micrositeopen
## 5.05346 -1.99806
## micrositeshrub shrub_density
## -2.18201 -0.08799
## micrositeopen:shrub_density micrositeshrub:shrub_density
## 0.03263 0.05514
##
## Degrees of Freedom: 57 Total (i.e. Null); 52 Residual
## Null Deviance: 251.7
## Residual Deviance: 191.8 AIC: 248
anova(model8, test = "Chisq")
## Analysis of Deviance Table
##
## Model: gaussian, link: identity
##
## Response: richness
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 251.72
## microsite 2 39.061 55 212.66 0.005015 **
## shrub_density 1 19.474 54 193.19 0.021571 *
## microsite:shrub_density 2 1.404 52 191.78 0.826641
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
richness_density <- ggplot(df, aes(shrub_density, richness, color = microsite)) +
geom_point(size = 0.5) +
scale_color_brewer(palette = "Paired") +
labs(x = "Shrub Density", y = "Richness") + theme_classic() + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) +
geom_smooth(method = lm, se = TRUE) + labs(tag = "B", x = NULL) + theme(legend.position = "none") + theme(aspect.ratio = 0.8)
richness_density
## `geom_smooth()` using formula = 'y ~ x'
### Evenness v density (Density is not significant for evenness)
model9 <- glm(evenness~microsite*shrub_density, data = df) ### It is NOT poisson for this distribution! It is gaussian!
model9
##
## Call: glm(formula = evenness ~ microsite * shrub_density, data = df)
##
## Coefficients:
## (Intercept) micrositeopen
## 0.892735 -0.452855
## micrositeshrub shrub_density
## -1.025832 -0.006926
## micrositeopen:shrub_density micrositeshrub:shrub_density
## 0.010858 0.039157
##
## Degrees of Freedom: 57 Total (i.e. Null); 52 Residual
## Null Deviance: 12.57
## Residual Deviance: 9.896 AIC: 76.04
anova(model9, test = "Chisq")
## Analysis of Deviance Table
##
## Model: gaussian, link: identity
##
## Response: evenness
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 12.5653
## microsite 2 2.26450 55 10.3008 0.002607 **
## shrub_density 1 0.00506 54 10.2957 0.870414
## microsite:shrub_density 2 0.39961 52 9.8961 0.349977
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
evenness_density <- ggplot(df, aes(shrub_density, evenness, color = microsite)) +
geom_point(size = 0.5) +
scale_color_brewer(palette = "Paired") +
labs(x = "Shrub Density per 20m radius", y = "Evenness") + theme_classic() + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) +
geom_smooth(method = lm, se = TRUE) + labs(tag = "C") + theme(legend.position = "none") + theme(aspect.ratio = 0.8)
evenness_density
## `geom_smooth()` using formula = 'y ~ x'
density <- (abundance_density/richness_density/evenness_density) + plot_layout(guides = 'collect') + theme(legend.position = 'right') + labs(color = "Microsite")
print(density)
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
# Abundance v Ambient temp (No significance)
model4 <- glm(evenness~microsite*mean_ambient_temp + shrub_density, family = "poisson", data = df)
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
model4 ### Need to run the model this way because the figures show that microsite and temp interaction is not significant.
##
## Call: glm(formula = evenness ~ microsite * mean_ambient_temp + shrub_density,
## family = "poisson", data = df)
##
## Coefficients:
## (Intercept) micrositeopen
## 0.274827 -2.296530
## micrositeshrub mean_ambient_temp
## -8.966668 -0.021756
## shrub_density micrositeopen:mean_ambient_temp
## 0.002833 0.076108
## micrositeshrub:mean_ambient_temp
## 0.338872
##
## Degrees of Freedom: 57 Total (i.e. Null); 51 Residual
## Null Deviance: 29.23
## Residual Deviance: 24.67 AIC: Inf
anova(model4, test = "Chisq")
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
## Analysis of Deviance Table
##
## Model: poisson, link: log
##
## Response: evenness
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 29.230
## microsite 2 4.0028 55 25.227 0.1351
## mean_ambient_temp 1 0.0103 54 25.216 0.9190
## shrub_density 1 0.0106 53 25.206 0.9181
## microsite:mean_ambient_temp 2 0.5341 51 24.672 0.7657
abundance_ambient <- ggplot(df, aes(mean_ambient_temp, abundance, color = microsite)) +
geom_point(size = 0.5) +
scale_color_brewer(palette = "Paired") +
labs(x = "Ambient Temperature (°C)", y = "Abundance") + theme_classic() + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) +
geom_smooth(method = lm, se = TRUE) + labs(tag = "A") + labs(x = NULL) + theme(legend.position = "none") + theme(aspect.ratio = 0.8)
abundance_ambient
## `geom_smooth()` using formula = 'y ~ x'
### Richness v Ambient temperature
model5 <- glm(richness~microsite*mean_ambient_temp + shrub_density, family = "poisson", data = df)
model5 ### Need to run the model this way because the figures show that microsite and temp interaction is not significant.
##
## Call: glm(formula = richness ~ microsite * mean_ambient_temp + shrub_density,
## family = "poisson", data = df)
##
## Coefficients:
## (Intercept) micrositeopen
## 1.723809 -2.551620
## micrositeshrub mean_ambient_temp
## -10.862741 -0.004581
## shrub_density micrositeopen:mean_ambient_temp
## -0.020931 0.087898
## micrositeshrub:mean_ambient_temp
## 0.443273
##
## Degrees of Freedom: 57 Total (i.e. Null); 51 Residual
## Null Deviance: 93.5
## Residual Deviance: 66.48 AIC: 235.4
anova(model5, test = "Chisq")
## Analysis of Deviance Table
##
## Model: poisson, link: log
##
## Response: richness
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 93.497
## microsite 2 12.1743 55 81.322 0.002272 **
## mean_ambient_temp 1 1.8426 54 79.480 0.174641
## shrub_density 1 5.7622 53 73.718 0.016374 *
## microsite:mean_ambient_temp 2 7.2411 51 66.476 0.026768 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(model5, pairwise~microsite|mean_ambient_temp) ### Higher richness at mimic microsites than shrub and open sites
## $emmeans
## mean_ambient_temp = 23:
## microsite emmean SE df asymp.LCL asymp.UCL
## mimic 1.398 0.112 Inf 1.178 1.62
## open 0.868 0.122 Inf 0.629 1.11
## shrub 0.729 0.256 Inf 0.227 1.23
##
## Results are given on the log (not the response) scale.
## Confidence level used: 0.95
##
## $contrasts
## mean_ambient_temp = 23:
## contrast estimate SE df z.ratio p.value
## mimic - open 0.530 0.164 Inf 3.243 0.0034
## mimic - shrub 0.669 0.282 Inf 2.375 0.0462
## open - shrub 0.139 0.285 Inf 0.487 0.8775
##
## Results are given on the log (not the response) scale.
## P value adjustment: tukey method for comparing a family of 3 estimates
richness_ambient <- ggplot(df, aes(mean_ambient_temp, richness, color = microsite)) +
geom_point(size = 0.5) +
scale_color_brewer(palette = "Paired") +
labs(x = "Ambient Temperature (°C)", y = "Richness") + theme_classic() + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) +
geom_smooth(method = lm, se = TRUE) + labs(tag = "B", x = NULL) + theme(legend.position = "none") + theme(aspect.ratio = 0.8)
richness_ambient
## `geom_smooth()` using formula = 'y ~ x'
### Evenness v ambient temperature (No significance)
library(patchwork)
model6 <- glm(evenness~microsite*mean_ambient_temp + shrub_density, family = "poisson", data = df)
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
model6 ### Need to run the model this way because the figures show that microsite and temp interaction is not significant.
##
## Call: glm(formula = evenness ~ microsite * mean_ambient_temp + shrub_density,
## family = "poisson", data = df)
##
## Coefficients:
## (Intercept) micrositeopen
## 0.274827 -2.296530
## micrositeshrub mean_ambient_temp
## -8.966668 -0.021756
## shrub_density micrositeopen:mean_ambient_temp
## 0.002833 0.076108
## micrositeshrub:mean_ambient_temp
## 0.338872
##
## Degrees of Freedom: 57 Total (i.e. Null); 51 Residual
## Null Deviance: 29.23
## Residual Deviance: 24.67 AIC: Inf
anova(model6, test = "Chisq")
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
## Analysis of Deviance Table
##
## Model: poisson, link: log
##
## Response: evenness
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 29.230
## microsite 2 4.0028 55 25.227 0.1351
## mean_ambient_temp 1 0.0103 54 25.216 0.9190
## shrub_density 1 0.0106 53 25.206 0.9181
## microsite:mean_ambient_temp 2 0.5341 51 24.672 0.7657
evenness_ambient <- ggplot(df, aes(mean_ambient_temp, evenness, color = microsite)) +
geom_point(size = 0.5) +
scale_color_brewer(palette = "Paired") +
labs(x = "Ambient Temperature (°C)", y = "Evenness") + theme_classic() + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) +
geom_smooth(method = lm, se = TRUE) + labs(tag = "C") + theme(aspect.ratio = 0.8)
evenness_ambient
## `geom_smooth()` using formula = 'y ~ x'
ambient <- (abundance_ambient / richness_ambient / evenness_ambient) +
plot_layout(guides = 'collect') +
theme(legend.position = 'right') + labs(color = "Microsite")
print(ambient)
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
### Abundance v ground temp (Need second opinion on this one!)
model10 <- glm(abundance~microsite*mean_ground_temp, family = poisson, data = df) ### Not poisson distribution! Gaussian!
model10
##
## Call: glm(formula = abundance ~ microsite * mean_ground_temp, family = poisson,
## data = df)
##
## Coefficients:
## (Intercept) micrositeopen
## 2.11764 0.12080
## micrositeshrub mean_ground_temp
## 3.64664 0.05299
## micrositeopen:mean_ground_temp micrositeshrub:mean_ground_temp
## -0.02285 -0.16287
##
## Degrees of Freedom: 57 Total (i.e. Null); 52 Residual
## Null Deviance: 4372
## Residual Deviance: 4033 AIC: 4276
anova(model10, test = "Chisq")
## Analysis of Deviance Table
##
## Model: poisson, link: log
##
## Response: abundance
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 4372.1
## microsite 2 241.766 55 4130.4 < 2.2e-16 ***
## mean_ground_temp 1 61.043 54 4069.3 5.585e-15 ***
## microsite:mean_ground_temp 2 35.921 52 4033.4 1.585e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(model10, pairwise~microsite|mean_ground_temp)
## $emmeans
## mean_ground_temp = 32.9:
## microsite emmean SE df asymp.LCL asymp.UCL
## mimic 3.86 0.0358 Inf 3.79 3.93
## open 3.23 0.0421 Inf 3.15 3.31
## shrub 2.15 0.2886 Inf 1.58 2.71
##
## Results are given on the log (not the response) scale.
## Confidence level used: 0.95
##
## $contrasts
## mean_ground_temp = 32.9:
## contrast estimate SE df z.ratio p.value
## mimic - open 0.631 0.0553 Inf 11.425 <.0001
## mimic - shrub 1.716 0.2908 Inf 5.899 <.0001
## open - shrub 1.084 0.2916 Inf 3.717 0.0006
##
## Results are given on the log (not the response) scale.
## P value adjustment: tukey method for comparing a family of 3 estimates
abundance_ground <- ggplot(df, aes(mean_ground_temp, abundance, color = microsite)) +
geom_point(size = 0.5) +
scale_color_brewer(palette = "Paired") +
labs(x = "Ground Temperature (°C)", y = "Abundance") + theme_classic() + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5),legend.title = element_blank(), axis.text = element_text(size = 10)) +
geom_smooth(method = lm, se = TRUE) + labs(tag = "A", x = NULL) + theme(legend.position = "none") + theme(aspect.ratio = 0.8)
abundance_ground
## `geom_smooth()` using formula = 'y ~ x'
model11 <- glm(richness~microsite*mean_ground_temp, family = poisson, data = df) ### Not poisson distribution! Gaussian!
model11
##
## Call: glm(formula = richness ~ microsite * mean_ground_temp, family = poisson,
## data = df)
##
## Coefficients:
## (Intercept) micrositeopen
## 0.6908803 -0.5632701
## micrositeshrub mean_ground_temp
## 1.2458992 0.0214299
## micrositeopen:mean_ground_temp micrositeshrub:mean_ground_temp
## 0.0008181 -0.0670169
##
## Degrees of Freedom: 57 Total (i.e. Null); 52 Residual
## Null Deviance: 93.5
## Residual Deviance: 79.5 AIC: 246.5
anova(model11, test = "Chisq")
## Analysis of Deviance Table
##
## Model: poisson, link: log
##
## Response: richness
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 93.497
## microsite 2 12.1743 55 81.322 0.002272 **
## mean_ground_temp 1 1.2781 54 80.044 0.258258
## microsite:mean_ground_temp 2 0.5461 52 79.498 0.761073
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
emmeans(model11, pairwise~microsite|mean_ground_temp)
## $emmeans
## mean_ground_temp = 32.9:
## microsite emmean SE df asymp.LCL asymp.UCL
## mimic 1.396 0.118 Inf 1.164 1.63
## open 0.860 0.137 Inf 0.592 1.13
## shrub 0.436 0.930 Inf -1.386 2.26
##
## Results are given on the log (not the response) scale.
## Confidence level used: 0.95
##
## $contrasts
## mean_ground_temp = 32.9:
## contrast estimate SE df z.ratio p.value
## mimic - open 0.536 0.181 Inf 2.964 0.0085
## mimic - shrub 0.961 0.937 Inf 1.025 0.5611
## open - shrub 0.424 0.940 Inf 0.451 0.8938
##
## Results are given on the log (not the response) scale.
## P value adjustment: tukey method for comparing a family of 3 estimates
richness_ground <- ggplot(df, aes(mean_ground_temp, richness, color = microsite)) +
geom_point(size = 0.5) +
scale_color_brewer(palette = "Paired") +
labs(x = "Ground Temperature (°C)", y = "Richness") + theme_classic() + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) +
geom_smooth(method = lm, se = TRUE) + labs(tag = "B", x = NULL) + theme(legend.position = "none") + theme(aspect.ratio = 0.8)
richness_ground
## `geom_smooth()` using formula = 'y ~ x'
### Evenness v ground temp
model12 <- glm(evenness~microsite*mean_ground_temp, family = poisson, data = df) ### Not poisson distribution! Gaussian!
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
model12
##
## Call: glm(formula = evenness ~ microsite * mean_ground_temp, family = poisson,
## data = df)
##
## Coefficients:
## (Intercept) micrositeopen
## -0.787014 -0.319166
## micrositeshrub mean_ground_temp
## -0.291376 0.017169
## micrositeopen:mean_ground_temp micrositeshrub:mean_ground_temp
## -0.006513 -0.024726
##
## Degrees of Freedom: 57 Total (i.e. Null); 52 Residual
## Null Deviance: 29.23
## Residual Deviance: 25.08 AIC: Inf
anova(model12, test = "Chisq")
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.380957
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.894750
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.045153
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.916350
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.644695
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.348832
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.325083
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.843220
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.578648
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.474139
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.631975
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.203575
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.791702
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.119247
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.485104
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.731271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.193550
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.659872
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.250558
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.374569
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.655243
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.481154
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.223718
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.692421
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.126784
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.949594
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.950271
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.332179
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.781074
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.039721
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.867563
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.011404
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.983088
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.073543
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.450561
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.693147
## Warning in dpois(y, mu, log = TRUE): non-integer x = 0.636514
## Warning in dpois(y, mu, log = TRUE): non-integer x = 1.213008
## Analysis of Deviance Table
##
## Model: poisson, link: log
##
## Response: evenness
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 29.230
## microsite 2 4.0028 55 25.227 0.1351
## mean_ground_temp 1 0.1375 54 25.089 0.7107
## microsite:mean_ground_temp 2 0.0134 52 25.076 0.9933
evenness_ground <- ggplot(df, aes(mean_ground_temp, evenness, color = microsite)) +
geom_point(size = 0.5) +
scale_color_brewer(palette = "Paired") +
labs(x = "Ground Temperature (°C)", y = "Evenness") + theme_classic() + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 10)) +
geom_smooth(method = lm, se = TRUE) + labs(tag = "C") + theme(legend.position = "none") + theme(aspect.ratio = 0.8)
evenness_ground
## `geom_smooth()` using formula = 'y ~ x'
combined_plot <- (abundance_ground / richness_ground / evenness_ground) +
plot_layout(guides = 'collect') +
theme(legend.position = 'right') + labs(color = "Microsite")
print(combined_plot)
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
## `geom_smooth()` using formula = 'y ~ x'
### Maps
library(maps)
##
## Attaching package: 'maps'
## The following object is masked from 'package:purrr':
##
## map
library(ggmap)
## The legacy packages maptools, rgdal, and rgeos, underpinning the sp package,
## which was just loaded, will retire in October 2023.
## Please refer to R-spatial evolution reports for details, especially
## https://r-spatial.org/r/2023/05/15/evolution4.html.
## It may be desirable to make the sf package available;
## package maintainers should consider adding sf to Suggests:.
## The sp package is now running under evolution status 2
## (status 2 uses the sf package in place of rgdal)
## ℹ Google's Terms of Service: <https://mapsplatform.google.com>
## ℹ Please cite ggmap if you use it! Use `citation("ggmap")` for details.
library(ggplot2)
# Set your Google Maps API key
api_key <- "AIzaSyBWSInlcZQ9hnFVEdCcZqD94IgOl95QhIs"
register_google(key = api_key)
# Specify the bounding box for the map with names
bounding_box <- c(left = -119.4, bottom = 34, right = -119.7, top = 36)
# Option 1
my_map_1 <- get_map(location = bounding_box, maptype = "terrain", source = "google", zoom = 9)
## ! Bounding box given to Google - spatial extent only approximate.
## ℹ <https://maps.googleapis.com/maps/api/staticmap?center=35,-119.55&zoom=9&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxx>
map1 <- ggmap(my_map_1) +
geom_point(data = site, aes(x = long, y = lat, color = "black"), size = 3, shape = 16) +
labs(title = "Map with Data Points")
map1
# Option 2
my_map_2 <- get_map(location = bounding_box, maptype = "roadmap", source = "google", zoom = 11)
## ! Bounding box given to Google - spatial extent only approximate.
## ℹ <https://maps.googleapis.com/maps/api/staticmap?center=35,-119.55&zoom=11&size=640x640&scale=2&maptype=roadmap&language=en-EN&key=xxx>
ggmap(my_map_2) +
geom_point(data = site, aes(x = long, y = lat, color = "black"), size = 3, shape = 16) +
labs(title = "Map with Data Points")
# Option 3
my_map_3 <- get_map(location = bounding_box, maptype = "hybrid", source = "google", zoom = 11)
## ! Bounding box given to Google - spatial extent only approximate.
## ℹ <https://maps.googleapis.com/maps/api/staticmap?center=35,-119.55&zoom=11&size=640x640&scale=2&maptype=hybrid&language=en-EN&key=xxx>
ggmap(my_map_3) +
geom_point(data = site, aes(x = long, y = lat, color = "black"), size = 3, shape = 16) +
labs(title = "Map with Data Points")
# Option 4
my_map_4 <- get_map(location = bounding_box, maptype = "terrain", source = "google", zoom = 8)
## ! Bounding box given to Google - spatial extent only approximate.
## ℹ <https://maps.googleapis.com/maps/api/staticmap?center=35,-119.55&zoom=8&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxx>
figure_1 <- ggmap(my_map_4) +
geom_point(data = site, aes(x = long, y = lat), color = "black", size = 2, shape = 16) +
labs(x = "Longitude", y = "Latitude")
figure_1
my_map_5 <- get_map(location = bounding_box, maptype = "terrain", source = "google", zoom = 11)
## ! Bounding box given to Google - spatial extent only approximate.
## ℹ <https://maps.googleapis.com/maps/api/staticmap?center=35,-119.55&zoom=11&size=640x640&scale=2&maptype=terrain&language=en-EN&key=xxx>
microsite <- read.csv("Chpt5_Site_Data.csv")
figure_2 <- ggmap(my_map_5) +
geom_point(data = microsite, aes(x = long, y = lat), size = 3, shape = 16) + scale_colour_brewer(palette = "Paired")+
labs(x = "Longitude", y = "Latitude")
figure_2
temp <- ggplot(df, aes(x = site_code, y = mean_ambient_temp, fill = microsite)) +
geom_boxplot() + stat_summary(fun = mean, geom = "point", shape = 18, size = 2, position = position_dodge(width = 0.75 )) + labs(
x = "Site",
y = "Ambient Temperature (°C)", fill = "Microsite") + theme_classic() +
scale_fill_manual(values = c("mimic" = "#a6cee3", "open" = "#1f78b4", "shrub" = "#b2df8a")) + theme(text = element_text(size = 12), panel.border = element_rect(color = "black", fill = NA, size = 1.5), axis.text = element_text(size = 7)) + theme(aspect.ratio = 1)
temp
p <- glm(mean_ambient_temp~microsite*site_code, family = "gaussian",data = df)
p
##
## Call: glm(formula = mean_ambient_temp ~ microsite * site_code, family = "gaussian",
## data = df)
##
## Coefficients:
## (Intercept)
## 20.9047
## micrositeopen
## 1.2207
## micrositeshrub
## 0.8149
## site_codeCarrizo_soda_shrub
## 5.4053
## site_codeCuyama_1
## 0.9247
## site_codeCuyama_3
## 1.1827
## micrositeopen:site_codeCarrizo_soda_shrub
## -2.3673
## micrositeshrub:site_codeCarrizo_soda_shrub
## -2.6460
## micrositeopen:site_codeCuyama_1
## -0.6800
## micrositeshrub:site_codeCuyama_1
## -0.7176
## micrositeopen:site_codeCuyama_3
## -0.8897
## micrositeshrub:site_codeCuyama_3
## NA
##
## Degrees of Freedom: 57 Total (i.e. Null); 47 Residual
## Null Deviance: 186.6
## Residual Deviance: 41.63 AIC: 169.4
anova(p, test = "Chisq")
## Analysis of Deviance Table
##
## Model: gaussian, link: identity
##
## Response: mean_ambient_temp
##
## Terms added sequentially (first to last)
##
##
## Df Deviance Resid. Df Resid. Dev Pr(>Chi)
## NULL 57 186.572
## microsite 2 1.399 55 185.173 0.45387
## site_code 3 131.274 52 53.899 < 2e-16 ***
## microsite:site_code 5 12.269 47 41.630 0.01658 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
em1 <- emmeans(p, pairwise~microsite|site_code)
em1
## $emmeans
## site_code = Carrizo_soda_open:
## microsite emmean SE df lower.CL upper.CL
## mimic 20.9 0.421 47 20.1 21.8
## open 22.1 0.421 47 21.3 23.0
## shrub nonEst NA NA NA NA
##
## site_code = Carrizo_soda_shrub:
## microsite emmean SE df lower.CL upper.CL
## mimic 26.3 0.421 47 25.5 27.2
## open 25.2 0.333 47 24.5 25.8
## shrub 24.5 0.543 47 23.4 25.6
##
## site_code = Cuyama_1:
## microsite emmean SE df lower.CL upper.CL
## mimic 21.8 0.421 47 21.0 22.7
## open 22.4 0.333 47 21.7 23.0
## shrub 21.9 0.543 47 20.8 23.0
##
## site_code = Cuyama_3:
## microsite emmean SE df lower.CL upper.CL
## mimic 22.1 0.421 47 21.2 22.9
## open 22.4 0.333 47 21.7 23.1
## shrub 22.9 0.543 47 21.8 24.0
##
## Confidence level used: 0.95
##
## $contrasts
## site_code = Carrizo_soda_open:
## contrast estimate SE df t.ratio p.value
## mimic - open -1.2207 0.595 47 -2.051 0.1114
## mimic - shrub nonEst NA NA NA NA
## open - shrub nonEst NA NA NA NA
##
## site_code = Carrizo_soda_shrub:
## contrast estimate SE df t.ratio p.value
## mimic - open 1.1467 0.537 47 2.137 0.0932
## mimic - shrub 1.8311 0.687 47 2.664 0.0279
## open - shrub 0.6844 0.637 47 1.074 0.5346
##
## site_code = Cuyama_1:
## contrast estimate SE df t.ratio p.value
## mimic - open -0.5407 0.537 47 -1.008 0.5757
## mimic - shrub -0.0973 0.687 47 -0.142 0.9890
## open - shrub 0.4433 0.637 47 0.696 0.7671
##
## site_code = Cuyama_3:
## contrast estimate SE df t.ratio p.value
## mimic - open -0.3310 0.537 47 -0.617 0.8116
## mimic - shrub -0.8149 0.687 47 -1.186 0.4675
## open - shrub -0.4839 0.637 47 -0.759 0.7294
##
## P value adjustment: tukey method for comparing a family of 3 estimates
em2 <- emmeans(p, pairwise~site_code|microsite)
em2
## $emmeans
## microsite = mimic:
## site_code emmean SE df lower.CL upper.CL
## Carrizo_soda_open 20.9 0.421 47 20.1 21.8
## Carrizo_soda_shrub 26.3 0.421 47 25.5 27.2
## Cuyama_1 21.8 0.421 47 21.0 22.7
## Cuyama_3 22.1 0.421 47 21.2 22.9
##
## microsite = open:
## site_code emmean SE df lower.CL upper.CL
## Carrizo_soda_open 22.1 0.421 47 21.3 23.0
## Carrizo_soda_shrub 25.2 0.333 47 24.5 25.8
## Cuyama_1 22.4 0.333 47 21.7 23.0
## Cuyama_3 22.4 0.333 47 21.7 23.1
##
## microsite = shrub:
## site_code emmean SE df lower.CL upper.CL
## Carrizo_soda_open nonEst NA NA NA NA
## Carrizo_soda_shrub 24.5 0.543 47 23.4 25.6
## Cuyama_1 21.9 0.543 47 20.8 23.0
## Cuyama_3 22.9 0.543 47 21.8 24.0
##
## Confidence level used: 0.95
##
## $contrasts
## microsite = mimic:
## contrast estimate SE df t.ratio p.value
## Carrizo_soda_open - Carrizo_soda_shrub -5.4053 0.595 47 -9.081 <.0001
## Carrizo_soda_open - Cuyama_1 -0.9247 0.595 47 -1.553 0.4147
## Carrizo_soda_open - Cuyama_3 -1.1827 0.595 47 -1.987 0.2075
## Carrizo_soda_shrub - Cuyama_1 4.4807 0.595 47 7.528 <.0001
## Carrizo_soda_shrub - Cuyama_3 4.2227 0.595 47 7.094 <.0001
## Cuyama_1 - Cuyama_3 -0.2580 0.595 47 -0.433 0.9724
##
## microsite = open:
## contrast estimate SE df t.ratio p.value
## Carrizo_soda_open - Carrizo_soda_shrub -3.0380 0.537 47 -5.662 <.0001
## Carrizo_soda_open - Cuyama_1 -0.2447 0.537 47 -0.456 0.9681
## Carrizo_soda_open - Cuyama_3 -0.2930 0.537 47 -0.546 0.9471
## Carrizo_soda_shrub - Cuyama_1 2.7933 0.471 47 5.936 <.0001
## Carrizo_soda_shrub - Cuyama_3 2.7450 0.471 47 5.833 <.0001
## Cuyama_1 - Cuyama_3 -0.0483 0.471 47 -0.103 0.9996
##
## microsite = shrub:
## contrast estimate SE df t.ratio p.value
## Carrizo_soda_open - Carrizo_soda_shrub nonEst NA NA NA NA
## Carrizo_soda_open - Cuyama_1 nonEst NA NA NA NA
## Carrizo_soda_open - Cuyama_3 nonEst NA NA NA NA
## Carrizo_soda_shrub - Cuyama_1 2.5522 0.768 47 3.321 0.0091
## Carrizo_soda_shrub - Cuyama_3 1.5767 0.768 47 2.052 0.1841
## Cuyama_1 - Cuyama_3 -0.9756 0.768 47 -1.270 0.5865
##
## P value adjustment: tukey method for comparing a family of 4 estimates